Skip to content

Commit

Permalink
merge main into amd-staging
Browse files Browse the repository at this point in the history
Change-Id: Ic1ca6ca7ee2fc4ae446732268442e5483775d09a
  • Loading branch information
Jenkins committed Dec 21, 2024
2 parents f077fb2 + c361fd5 commit bd7e469
Show file tree
Hide file tree
Showing 65 changed files with 679 additions and 1,711 deletions.
70 changes: 0 additions & 70 deletions llvm/include/llvm/CodeGen/DroppedVariableStatsMIR.h

This file was deleted.

2 changes: 0 additions & 2 deletions llvm/include/llvm/CodeGen/MachineFunctionPass.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#ifndef LLVM_CODEGEN_MACHINEFUNCTIONPASS_H
#define LLVM_CODEGEN_MACHINEFUNCTIONPASS_H

#include "llvm/CodeGen/DroppedVariableStatsMIR.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/Pass.h"

Expand Down Expand Up @@ -68,7 +67,6 @@ class MachineFunctionPass : public FunctionPass {
MachineFunctionProperties RequiredProperties;
MachineFunctionProperties SetProperties;
MachineFunctionProperties ClearedProperties;
DroppedVariableStatsMIR DroppedVarStatsMF;

/// createPrinterPass - Get a machine function printer pass.
Pass *createPrinterPass(raw_ostream &O,
Expand Down
2 changes: 2 additions & 0 deletions llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def : GINodeEquiv<G_SDIV, sdiv>;
def : GINodeEquiv<G_UDIV, udiv>;
def : GINodeEquiv<G_SREM, srem>;
def : GINodeEquiv<G_UREM, urem>;
def : GINodeEquiv<G_SDIVREM, sdivrem>;
def : GINodeEquiv<G_UDIVREM, udivrem>;
def : GINodeEquiv<G_AND, and>;
def : GINodeEquiv<G_OR, or>;
def : GINodeEquiv<G_XOR, xor>;
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Target/TargetSelectionDAG.td
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def SDTIntShiftDOp: SDTypeProfile<1, 3, [ // fshl, fshr
def SDTIntSatNoShOp : SDTypeProfile<1, 2, [ // ssat with no shift
SDTCisSameAs<0, 1>, SDTCisInt<2>
]>;
def SDTIntBinHiLoOp : SDTypeProfile<2, 2, [ // mulhi, mullo, sdivrem, udivrem
SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>,SDTCisInt<0>
def SDTIntBinHiLoOp : SDTypeProfile<2, 2, [ // smullohi, umullohi, sdivrem, udivrem
SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisInt<0>
]>;
def SDTIntScaledBinOp : SDTypeProfile<1, 3, [ // smulfix, sdivfix, etc
SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisInt<0>, SDTCisInt<3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ class MemDGNode final : public DGNode {
void setNextNode(MemDGNode *N) { NextMemN = N; }
void setPrevNode(MemDGNode *N) { PrevMemN = N; }
friend class DependencyGraph; // For setNextNode(), setPrevNode().
void detachFromChain() {
if (PrevMemN != nullptr)
PrevMemN->NextMemN = NextMemN;
if (NextMemN != nullptr)
NextMemN->PrevMemN = PrevMemN;
PrevMemN = nullptr;
NextMemN = nullptr;
}

public:
MemDGNode(Instruction *I) : DGNode(I, DGNodeID::MemDGNode) {
Expand Down Expand Up @@ -293,6 +301,7 @@ class DependencyGraph {
Context *Ctx = nullptr;
std::optional<Context::CallbackID> CreateInstrCB;
std::optional<Context::CallbackID> EraseInstrCB;
std::optional<Context::CallbackID> MoveInstrCB;

std::unique_ptr<BatchAAResults> BatchAA;

Expand Down Expand Up @@ -343,6 +352,9 @@ class DependencyGraph {
/// Called by the callbacks when instruction \p I is about to get
/// deleted.
void notifyEraseInstr(Instruction *I);
/// Called by the callbacks when instruction \p I is about to be moved to
/// \p To.
void notifyMoveInstr(Instruction *I, const BBIterator &To);

public:
/// This constructor also registers callbacks.
Expand All @@ -352,12 +364,18 @@ class DependencyGraph {
[this](Instruction *I) { notifyCreateInstr(I); });
EraseInstrCB = Ctx.registerEraseInstrCallback(
[this](Instruction *I) { notifyEraseInstr(I); });
MoveInstrCB = Ctx.registerMoveInstrCallback(
[this](Instruction *I, const BBIterator &To) {
notifyMoveInstr(I, To);
});
}
~DependencyGraph() {
if (CreateInstrCB)
Ctx->unregisterCreateInstrCallback(*CreateInstrCB);
if (EraseInstrCB)
Ctx->unregisterEraseInstrCallback(*EraseInstrCB);
if (MoveInstrCB)
Ctx->unregisterMoveInstrCallback(*MoveInstrCB);
}

DGNode *getNode(Instruction *I) const {
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/CodeGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ add_llvm_component_library(LLVMCodeGen
DeadMachineInstructionElim.cpp
DetectDeadLanes.cpp
DFAPacketizer.cpp
DroppedVariableStatsMIR.cpp
DwarfEHPrepare.cpp
EarlyIfConversion.cpp
EdgeBundles.cpp
Expand Down
77 changes: 0 additions & 77 deletions llvm/lib/CodeGen/DroppedVariableStatsMIR.cpp

This file was deleted.

15 changes: 1 addition & 14 deletions llvm/lib/CodeGen/MachineFunctionPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
using namespace llvm;
using namespace ore;

static cl::opt<bool> DroppedVarStatsMIR(
"dropped-variable-stats-mir", cl::Hidden,
cl::desc("Dump dropped debug variables stats for MIR passes"),
cl::init(false));

Pass *MachineFunctionPass::createPrinterPass(raw_ostream &O,
const std::string &Banner) const {
return createMachineFunctionPrinterPass(O, Banner);
Expand Down Expand Up @@ -96,15 +91,7 @@ bool MachineFunctionPass::runOnFunction(Function &F) {

MFProps.reset(ClearedProperties);

bool RV;
if (DroppedVarStatsMIR) {
auto PassName = getPassName();
DroppedVarStatsMF.runBeforePass(PassName, &MF);
RV = runOnMachineFunction(MF);
DroppedVarStatsMF.runAfterPass(PassName, &MF);
} else {
RV = runOnMachineFunction(MF);
}
bool RV = runOnMachineFunction(MF);

if (ShouldEmitSizeRemarks) {
// We wanted size remarks. Check if there was a change to the number of
Expand Down
7 changes: 5 additions & 2 deletions llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,13 +563,16 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
[=](const LegalityQuery &Query) { return Query.Types[1] == v2s16; },
1, s32)
.minScalarOrEltIf(
[=](const LegalityQuery &Query) { return Query.Types[1] == v2p0; }, 0,
s64)
[=](const LegalityQuery &Query) {
return Query.Types[1].isPointerVector();
},
0, s64)
.moreElementsToNextPow2(1)
.clampNumElements(1, v8s8, v16s8)
.clampNumElements(1, v4s16, v8s16)
.clampNumElements(1, v2s32, v4s32)
.clampNumElements(1, v2s64, v2s64)
.clampNumElements(1, v2p0, v2p0)
.customIf(isVector(0));

getActionDefinitionsBuilder(G_FCMP)
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,8 @@ AArch64StringToVectorLayout(StringRef LayoutStr) {

namespace AArch64SysReg {
struct SysReg {
const char *Name;
const char *AltName;
const char Name[32];
const char AltName[32];
unsigned Encoding;
bool Readable;
bool Writeable;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/ARM/Utils/ARMBaseInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ inline static unsigned ARMCondCodeFromString(StringRef CC) {
// System Registers
namespace ARMSysReg {
struct MClassSysReg {
const char *Name;
const char Name[32];
uint16_t M1Encoding12;
uint16_t M2M3Encoding8;
uint16_t Encoding;
Expand Down
8 changes: 5 additions & 3 deletions llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
if (!IsConstantImm)
IsValid = RISCVAsmParser::classifySymbolRef(getImm(), VK);
else
IsValid = isShiftedInt<N - 1, 1>(Imm);
IsValid = isShiftedInt<N - 1, 1>(fixImmediateForRV32(Imm, isRV64Imm()));
return IsValid && VK == RISCVMCExpr::VK_RISCV_None;
}

Expand Down Expand Up @@ -943,7 +943,8 @@ struct RISCVOperand final : public MCParsedAsmOperand {
RISCVMCExpr::VariantKind VK = RISCVMCExpr::VK_RISCV_None;
int64_t Imm;
bool IsConstantImm = evaluateConstantImm(getImm(), Imm, VK);
return IsConstantImm && isShiftedInt<7, 5>(Imm) &&
return IsConstantImm &&
isShiftedInt<7, 5>(fixImmediateForRV32(Imm, isRV64Imm())) &&
VK == RISCVMCExpr::VK_RISCV_None;
}

Expand All @@ -955,7 +956,8 @@ struct RISCVOperand final : public MCParsedAsmOperand {
int64_t Imm;
RISCVMCExpr::VariantKind VK = RISCVMCExpr::VK_RISCV_None;
bool IsConstantImm = evaluateConstantImm(getImm(), Imm, VK);
return IsConstantImm && (Imm != 0) && isShiftedInt<6, 4>(Imm) &&
return IsConstantImm && (Imm != 0) &&
isShiftedInt<6, 4>(fixImmediateForRV32(Imm, isRV64Imm())) &&
VK == RISCVMCExpr::VK_RISCV_None;
}

Expand Down
12 changes: 6 additions & 6 deletions llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ enum OperandType : unsigned {
OPERAND_UIMM11,
OPERAND_UIMM12,
OPERAND_UIMM16,
OPERAND_UIMM20,
OPERAND_UIMMLOG2XLEN,
OPERAND_UIMMLOG2XLEN_NONZERO,
OPERAND_UIMM32,
OPERAND_UIMM48,
OPERAND_UIMM64,
Expand All @@ -327,9 +330,6 @@ enum OperandType : unsigned {
OPERAND_SIMM10_LSB0000_NONZERO,
OPERAND_SIMM12,
OPERAND_SIMM12_LSB00000,
OPERAND_UIMM20,
OPERAND_UIMMLOG2XLEN,
OPERAND_UIMMLOG2XLEN_NONZERO,
OPERAND_CLUI_IMM,
OPERAND_VTYPEI10,
OPERAND_VTYPEI11,
Expand Down Expand Up @@ -452,9 +452,9 @@ int getLoadFPImm(APFloat FPImm);

namespace RISCVSysReg {
struct SysReg {
const char *Name;
const char *AltName;
const char *DeprecatedName;
const char Name[32];
const char AltName[32];
const char DeprecatedName[32];
unsigned Encoding;
// FIXME: add these additional fields when needed.
// Privilege Access: Read, Write, Read-Only.
Expand Down
Loading

0 comments on commit bd7e469

Please sign in to comment.