[NFC][CodeGen] Adopt MachineFunctionProperties convenience accessors (#141101)

This commit is contained in:
Rahul Joshi 2025-05-23 08:30:29 -07:00 committed by GitHub
parent 204eb70af8
commit 52c2e45c11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
114 changed files with 141 additions and 267 deletions

View File

@ -19,8 +19,7 @@ public:
MachineFunctionAnalysisManager &MFAM);
MachineFunctionProperties getRequiredProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
};

View File

@ -448,7 +448,7 @@ public:
// Intentionally create a virtual register and set NoVRegs property.
auto &MRI = MF.getRegInfo();
MRI.createGenericVirtualRegister(LLT::scalar(8));
MF.getProperties().set(MachineFunctionProperties::Property::NoVRegs);
MF.getProperties().setNoVRegs();
return PreservedAnalyses::all();
}
@ -466,19 +466,18 @@ public:
}
static MachineFunctionProperties getRequiredProperties() {
MachineFunctionProperties MFProps;
MFProps.set(MachineFunctionProperties::Property::FailedISel);
MFProps.set(MachineFunctionProperties::Property::FailsVerification);
MFProps.set(MachineFunctionProperties::Property::IsSSA);
MFProps.set(MachineFunctionProperties::Property::Legalized);
MFProps.set(MachineFunctionProperties::Property::NoPHIs);
MFProps.set(MachineFunctionProperties::Property::NoVRegs);
MFProps.set(MachineFunctionProperties::Property::RegBankSelected);
MFProps.set(MachineFunctionProperties::Property::Selected);
MFProps.set(MachineFunctionProperties::Property::TiedOpsRewritten);
MFProps.set(MachineFunctionProperties::Property::TracksDebugUserValues);
MFProps.set(MachineFunctionProperties::Property::TracksLiveness);
return MFProps;
return MachineFunctionProperties()
.setFailedISel()
.setFailsVerification()
.setIsSSA()
.setLegalized()
.setNoPHIs()
.setNoVRegs()
.setRegBankSelected()
.setSelected()
.setTiedOpsRewritten()
.setTracksDebugUserValues()
.setTracksLiveness();
}
static StringRef name() { return "RequireAllMachineFunctionPropertiesPass"; }
};

View File

@ -86,8 +86,7 @@ public:
bool runOnMachineFunction(MachineFunction &F) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {

View File

@ -117,8 +117,7 @@ public:
bool runOnMachineFunction(MachineFunction &F) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {

View File

@ -132,8 +132,7 @@ struct AArch64CollectLOH : public MachineFunctionPass {
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override { return AARCH64_COLLECT_LOH_NAME; }

View File

@ -52,8 +52,7 @@ public:
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {
return "AArch64 Compress Jump Tables";

View File

@ -188,8 +188,7 @@ public:
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
private:

View File

@ -1121,7 +1121,7 @@ let RecomputePerFunction = 1 in {
// SelectionDAG's behaviour.
// FIXME: One day there will probably be a nicer way to check for this, but
// today is not that day.
def OptimizedGISelOrOtherSelector : Predicate<"!MF->getFunction().hasOptNone() || MF->getProperties().hasProperty(MachineFunctionProperties::Property::FailedISel) || !MF->getProperties().hasProperty(MachineFunctionProperties::Property::Legalized)">;
def OptimizedGISelOrOtherSelector : Predicate<"!MF->getFunction().hasOptNone() || MF->getProperties().hasFailedISel() || !MF->getProperties().hasLegalized()">;
}
include "AArch64InstrFormats.td"

View File

@ -233,8 +233,7 @@ struct AArch64LoadStoreOpt : public MachineFunctionPass {
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override { return AARCH64_LOAD_STORE_OPT_NAME; }

View File

@ -173,9 +173,7 @@ static MachineFunction &createFrameHelperMachineFunction(Module *M,
MachineFunction &MF = MMI->getOrCreateMachineFunction(*F);
// Remove unnecessary register liveness and set NoVRegs.
MF.getProperties().reset(MachineFunctionProperties::Property::TracksLiveness);
MF.getProperties().reset(MachineFunctionProperties::Property::IsSSA);
MF.getProperties().set(MachineFunctionProperties::Property::NoVRegs);
MF.getProperties().resetTracksLiveness().resetIsSSA().setNoVRegs();
MF.getRegInfo().freezeReservedRegs();
// Create entry block.

View File

@ -92,8 +92,7 @@ public:
bool optimizeBlock(MachineBasicBlock *MBB);
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {
return "AArch64 Redundant Copy Elimination";

View File

@ -544,8 +544,7 @@ AArch64RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
// the pipeline since it prevents other infrastructure from reasoning about
// it's liveness. We use the NoVRegs property instead of IsSSA because
// IsSSA is removed before VirtRegRewriter runs.
if (!MF.getProperties().hasProperty(
MachineFunctionProperties::Property::NoVRegs))
if (!MF.getProperties().hasNoVRegs())
markSuperRegs(Reserved, AArch64::LR);
}

View File

@ -147,8 +147,7 @@ AArch64O0PreLegalizerCombiner::AArch64O0PreLegalizerCombiner()
}
bool AArch64O0PreLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
auto &TPC = getAnalysis<TargetPassConfig>();

View File

@ -654,12 +654,9 @@ AArch64PostLegalizerCombiner::AArch64PostLegalizerCombiner(bool IsOptNone)
}
bool AArch64PostLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
assert(MF.getProperties().hasProperty(
MachineFunctionProperties::Property::Legalized) &&
"Expected a legalized function?");
assert(MF.getProperties().hasLegalized() && "Expected a legalized function?");
auto *TPC = &getAnalysis<TargetPassConfig>();
const Function &F = MF.getFunction();
bool EnableOpt =

View File

@ -1257,12 +1257,9 @@ AArch64PostLegalizerLowering::AArch64PostLegalizerLowering()
}
bool AArch64PostLegalizerLowering::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
assert(MF.getProperties().hasProperty(
MachineFunctionProperties::Property::Legalized) &&
"Expected a legalized function?");
assert(MF.getProperties().hasLegalized() && "Expected a legalized function?");
auto *TPC = &getAnalysis<TargetPassConfig>();
const Function &F = MF.getFunction();

View File

@ -292,12 +292,9 @@ bool AArch64PostSelectOptimize::optimizeNZCVDefs(MachineBasicBlock &MBB) {
}
bool AArch64PostSelectOptimize::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
assert(MF.getProperties().hasProperty(
MachineFunctionProperties::Property::Selected) &&
"Expected a selected MF");
assert(MF.getProperties().hasSelected() && "Expected a selected MF");
bool Changed = false;
for (auto &BB : MF) {

View File

@ -836,8 +836,7 @@ AArch64PreLegalizerCombiner::AArch64PreLegalizerCombiner()
}
bool AArch64PreLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
auto &TPC = getAnalysis<TargetPassConfig>();

View File

@ -478,8 +478,7 @@ AMDGPUPostLegalizerCombiner::AMDGPUPostLegalizerCombiner(bool IsOptNone)
}
bool AMDGPUPostLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
auto *TPC = &getAnalysis<TargetPassConfig>();
const Function &F = MF.getFunction();

View File

@ -253,8 +253,7 @@ AMDGPUPreLegalizerCombiner::AMDGPUPreLegalizerCombiner(bool IsOptNone)
}
bool AMDGPUPreLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
auto *TPC = &getAnalysis<TargetPassConfig>();
const Function &F = MF.getFunction();

View File

@ -462,8 +462,7 @@ AMDGPURegBankCombiner::AMDGPURegBankCombiner(bool IsOptNone)
}
bool AMDGPURegBankCombiner::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
auto *TPC = &getAnalysis<TargetPassConfig>();
const Function &F = MF.getFunction();

View File

@ -58,8 +58,7 @@ public:
// If there were no phis and we do waterfall expansion machine verifier would
// fail.
MachineFunctionProperties getClearedProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoPHIs);
return MachineFunctionProperties().setNoPHIs();
}
};
@ -250,8 +249,7 @@ public:
}
bool AMDGPURegBankLegalize::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
// Setup the instruction builder with CSE.

View File

@ -53,8 +53,7 @@ public:
// This pass assigns register banks to all virtual registers, and we maintain
// this property in subsequent passes
MachineFunctionProperties getSetProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::RegBankSelected);
return MachineFunctionProperties().setRegBankSelected();
}
};
@ -199,8 +198,7 @@ static Register getVReg(MachineOperand &Op) {
}
bool AMDGPURegBankSelect::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
// Setup the instruction builder with CSE.

View File

@ -98,8 +98,7 @@ public:
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties()
.set(MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
};

View File

@ -18,8 +18,7 @@ public:
MachineFunctionAnalysisManager &MAM);
MachineFunctionProperties getRequiredProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
};

View File

@ -121,8 +121,7 @@ public:
bool runOnMachineFunction(MachineFunction &MF) override {
// FIXME: This pass causes verification failures.
MF.getProperties().set(
MachineFunctionProperties::Property::FailsVerification);
MF.getProperties().setFailsVerification();
TII = MF.getSubtarget<R600Subtarget>().getInstrInfo();
TRI = &TII->getRegisterInfo();

View File

@ -111,8 +111,7 @@ public:
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties()
.set(MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
StringRef getPassName() const override {

View File

@ -618,8 +618,7 @@ static bool hoistAndMergeSGPRInits(unsigned Reg,
bool SIFixSGPRCopies::run(MachineFunction &MF) {
// Only need to run this in SelectionDAG path.
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::Selected))
if (MF.getProperties().hasSelected())
return false;
const GCNSubtarget &ST = MF.getSubtarget<GCNSubtarget>();

View File

@ -191,8 +191,7 @@ public:
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
};

View File

@ -19,8 +19,7 @@ public:
MachineFunctionAnalysisManager &MFAM);
MachineFunctionProperties getRequiredProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
};
} // namespace llvm

View File

@ -78,8 +78,7 @@ public:
}
MachineFunctionProperties getClearedProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
};

View File

@ -323,8 +323,7 @@ public:
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties()
.set(MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
};

View File

@ -20,8 +20,7 @@ public:
MachineFunctionAnalysisManager &MFAM);
MachineFunctionProperties getRequiredProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
};

View File

@ -859,8 +859,7 @@ void Vreg1LoweringHelper::constrainAsLaneMask(Incoming &In) {}
static bool runFixI1Copies(MachineFunction &MF, MachineDominatorTree &MDT,
MachinePostDominatorTree &MPDT) {
// Only need to run this in SelectionDAG path.
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::Selected))
if (MF.getProperties().hasSelected())
return false;
Vreg1LoweringHelper Helper(&MF, &MDT, &MPDT);

View File

@ -81,9 +81,7 @@ public:
MachineFunctionProperties getClearedProperties() const override {
// SILowerSGPRSpills introduces new Virtual VGPRs for spilling SGPRs.
return MachineFunctionProperties()
.set(MachineFunctionProperties::Property::IsSSA)
.set(MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setIsSSA().setNoVRegs();
}
};

View File

@ -19,9 +19,7 @@ public:
MachineFunctionProperties getClearedProperties() const {
// SILowerSGPRSpills introduces new Virtual VGPRs for spilling SGPRs.
return MachineFunctionProperties()
.set(MachineFunctionProperties::Property::IsSSA)
.set(MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setIsSSA().setNoVRegs();
}
};
} // namespace llvm

View File

@ -166,13 +166,11 @@ public:
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
MachineFunctionProperties getClearedProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoPHIs);
return MachineFunctionProperties().setNoPHIs();
}
};

View File

@ -19,13 +19,11 @@ public:
MachineFunctionAnalysisManager &MFAM);
MachineFunctionProperties getRequiredProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
MachineFunctionProperties getClearedProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoPHIs);
return MachineFunctionProperties().setNoPHIs();
}
};
} // namespace llvm

View File

@ -417,8 +417,7 @@ void SIShrinkInstructions::shrinkMadFma(MachineInstr &MI) const {
return;
// There is no advantage to doing this pre-RA.
if (!MF->getProperties().hasProperty(
MachineFunctionProperties::Property::NoVRegs))
if (!MF->getProperties().hasNoVRegs())
return;
if (TII->hasAnyModifiersSet(MI))
@ -951,8 +950,7 @@ bool SIShrinkInstructions::run(MachineFunction &MF) {
if (TII->isMIMG(MI.getOpcode()) &&
ST->getGeneration() >= AMDGPUSubtarget::GFX10 &&
MF.getProperties().hasProperty(
MachineFunctionProperties::Property::NoVRegs)) {
MF.getProperties().hasNoVRegs()) {
shrinkMIMG(MI);
continue;
}
@ -1063,9 +1061,7 @@ bool SIShrinkInstructions::run(MachineFunction &MF) {
// fold an immediate into the shrunk instruction as a literal operand. In
// GFX10 VOP3 instructions can take a literal operand anyway, so there is
// no advantage to doing this.
if (ST->hasVOP3Literal() &&
!MF.getProperties().hasProperty(
MachineFunctionProperties::Property::NoVRegs))
if (ST->hasVOP3Literal() && !MF.getProperties().hasNoVRegs())
continue;
if (ST->hasTrue16BitInsts() && AMDGPU::isTrue16Inst(MI.getOpcode()) &&

View File

@ -256,8 +256,7 @@ public:
}
MachineFunctionProperties getClearedProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
};
} // end anonymous namespace

View File

@ -18,8 +18,7 @@ public:
MachineFunctionAnalysisManager &MFAM);
MachineFunctionProperties getClearedProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
};
} // namespace llvm

View File

@ -234,8 +234,7 @@ namespace {
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {

View File

@ -51,8 +51,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {

View File

@ -75,8 +75,7 @@ public:
bool runOnMachineFunction(MachineFunction &F) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {

View File

@ -12157,7 +12157,7 @@ ARMTargetLowering::EmitInstrWithCustomInserter(MachineInstr &MI,
OpDestReg, OpSizeReg, TotalIterationsReg, IsMemcpy);
// Required to avoid conflict with the MachineVerifier during testing.
Properties.reset(MachineFunctionProperties::Property::NoPHIs);
Properties.resetNoPHIs();
// Connect the blocks
TpEntry->addSuccessor(TpLoopBody);

View File

@ -119,8 +119,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override { return ARM_LOAD_STORE_OPT_NAME; }

View File

@ -489,9 +489,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs).set(
MachineFunctionProperties::Property::TracksLiveness);
return MachineFunctionProperties().setNoVRegs().setTracksLiveness();
}
StringRef getPassName() const override {
@ -1293,7 +1291,7 @@ bool ARMLowOverheadLoops::runOnMachineFunction(MachineFunction &mf) {
MLI = &getAnalysis<MachineLoopInfoWrapperPass>().getLI();
RDA = &getAnalysis<ReachingDefAnalysis>();
MF->getProperties().set(MachineFunctionProperties::Property::TracksLiveness);
MF->getProperties().setTracksLiveness();
MRI = &MF->getRegInfo();
TII = static_cast<const ARMBaseInstrInfo*>(ST.getInstrInfo());
TRI = ST.getRegisterInfo();

View File

@ -26,8 +26,7 @@ public:
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override { return "optimise barriers pass"; }

View File

@ -41,8 +41,7 @@ public:
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {

View File

@ -467,7 +467,7 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF,
// In some cases, virtual registers have been introduced, e.g. by uses of
// emitThumbRegPlusImmInReg.
MF.getProperties().reset(MachineFunctionProperties::Property::NoVRegs);
MF.getProperties().resetNoVRegs();
}
void Thumb1FrameLowering::emitEpilogue(MachineFunction &MF,

View File

@ -52,8 +52,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {

View File

@ -167,8 +167,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {

View File

@ -218,8 +218,7 @@ public:
bool runOnMachineFunction(MachineFunction &F) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
void doInitialPlacement(std::vector<MachineInstr *> &CPEMIs);

View File

@ -40,8 +40,7 @@ public:
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
};

View File

@ -75,8 +75,7 @@ public:
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
private:

View File

@ -38,8 +38,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {

View File

@ -207,8 +207,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
};

View File

@ -73,8 +73,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
private:

View File

@ -80,8 +80,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
private:

View File

@ -70,8 +70,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
static char ID;

View File

@ -40,8 +40,7 @@ namespace {
}
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
};
}

View File

@ -101,8 +101,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
private:
@ -198,8 +197,7 @@ static MachineBasicBlock::iterator moveInstrOut(MachineInstr &MI,
bool HexagonPacketizer::runOnMachineFunction(MachineFunction &MF) {
// FIXME: This pass causes verification failures.
MF.getProperties().set(
MachineFunctionProperties::Property::FailsVerification);
MF.getProperties().setFailsVerification();
auto &HST = MF.getSubtarget<HexagonSubtarget>();
HII = HST.getInstrInfo();

View File

@ -57,8 +57,7 @@ struct Filler : public MachineFunctionPass {
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
void insertDefsUses(MachineBasicBlock::instr_iterator MI,

View File

@ -61,8 +61,7 @@ public:
bool runOnMachineFunction(MachineFunction &F) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
private:

View File

@ -5729,7 +5729,7 @@ emitSelectPseudo(MachineInstr &MI, MachineBasicBlock *BB,
SelectMBBI = Next;
}
F->getProperties().reset(MachineFunctionProperties::Property::NoPHIs);
F->getProperties().resetNoPHIs();
return TailMBB;
}

View File

@ -58,8 +58,7 @@ public:
LoongArchMergeBaseOffsetOpt() : MachineFunctionPass(ID) {}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
void getAnalysisUsage(AnalysisUsage &AU) const override {

View File

@ -53,8 +53,7 @@ public:
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
private:

View File

@ -53,8 +53,7 @@ public:
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override { return "MSP430 Branch Selector"; }

View File

@ -145,8 +145,7 @@ public:
bool runOnMachineFunction(MachineFunction &F) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
private:

View File

@ -364,8 +364,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &F) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
void doInitialPlacement(std::vector<MachineInstr*> &CPEMIs);

View File

@ -228,8 +228,7 @@ namespace {
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
void getAnalysisUsage(AnalysisUsage &AU) const override {

View File

@ -41,8 +41,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {

View File

@ -40,8 +40,7 @@ public:
StringRef getPassName() const override { return "Mips VR4300 mulmul bugfix"; }
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
bool runOnMachineFunction(MachineFunction &MF) override;

View File

@ -122,8 +122,7 @@ MipsPostLegalizerCombiner::MipsPostLegalizerCombiner(bool IsOptNone)
}
bool MipsPostLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
auto *TPC = &getAnalysis<TargetPassConfig>();
const Function &F = MF.getFunction();

View File

@ -113,8 +113,7 @@ MipsPreLegalizerCombiner::MipsPreLegalizerCombiner()
: MachineFunctionPass(ID) {}
bool MipsPreLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
auto *TPC = &getAnalysis<TargetPassConfig>();

View File

@ -58,8 +58,7 @@ namespace {
bool runOnMachineFunction(MachineFunction &Fn) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override { return "PowerPC Branch Selector"; }

View File

@ -253,8 +253,7 @@ void PPCCTRLoops::expandNormalLoops(MachineLoop *ML, MachineInstr *Start,
MRI->createVirtualRegister(Is64Bit ? &PPC::G8RC_and_G8RC_NOX0RegClass
: &PPC::GPRC_and_GPRC_NOR0RegClass);
Start->getParent()->getParent()->getProperties().reset(
MachineFunctionProperties::Property::NoPHIs);
Start->getParent()->getParent()->getProperties().resetNoPHIs();
// Generate "PHI" in the header block.
auto PHIMIB = BuildMI(*ML->getHeader(), ML->getHeader()->getFirstNonPHI(),

View File

@ -181,8 +181,7 @@ public:
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
void getAnalysisUsage(AnalysisUsage &AU) const override {

View File

@ -102,8 +102,7 @@ static bool hasPCRelativeForm(MachineInstr &Use) {
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
// This function removes any redundant load immediates. It has two level

View File

@ -115,8 +115,7 @@ RISCVO0PreLegalizerCombiner::RISCVO0PreLegalizerCombiner()
}
bool RISCVO0PreLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
auto &TPC = getAnalysis<TargetPassConfig>();

View File

@ -123,12 +123,9 @@ RISCVPostLegalizerCombiner::RISCVPostLegalizerCombiner()
}
bool RISCVPostLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
assert(MF.getProperties().hasProperty(
MachineFunctionProperties::Property::Legalized) &&
"Expected a legalized function?");
assert(MF.getProperties().hasLegalized() && "Expected a legalized function?");
auto *TPC = &getAnalysis<TargetPassConfig>();
const Function &F = MF.getFunction();
bool EnableOpt =

View File

@ -121,8 +121,7 @@ RISCVPreLegalizerCombiner::RISCVPreLegalizerCombiner()
}
bool RISCVPreLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
auto &TPC = getAnalysis<TargetPassConfig>();

View File

@ -21180,7 +21180,7 @@ static MachineBasicBlock *emitSelectPseudo(MachineInstr &MI,
SelectMBBI = Next;
}
F->getProperties().reset(MachineFunctionProperties::Property::NoPHIs);
F->getProperties().resetNoPHIs();
return TailMBB;
}

View File

@ -48,8 +48,7 @@ struct RISCVLoadStoreOpt : public MachineFunctionPass {
RISCVLoadStoreOpt() : MachineFunctionPass(ID) {}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
void getAnalysisUsage(AnalysisUsage &AU) const override {

View File

@ -47,8 +47,7 @@ public:
RISCVMergeBaseOffsetOpt() : MachineFunctionPass(ID) {}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
void getAnalysisUsage(AnalysisUsage &AU) const override {

View File

@ -48,8 +48,7 @@ public:
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {

View File

@ -58,8 +58,7 @@ public:
// TODO: We could move this closer to regalloc, out of SSA, which would
// allow scheduling past mask operands. We would need to preserve live
// intervals.
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
};

View File

@ -51,8 +51,7 @@ public:
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
return MachineFunctionProperties().setIsSSA();
}
StringRef getPassName() const override {

View File

@ -2052,7 +2052,7 @@ static void patchPhis(const Module &M, SPIRVGlobalRegistry *GR,
}
}
MF->getProperties().set(MachineFunctionProperties::Property::NoPHIs);
MF->getProperties().setNoPHIs();
}
}

View File

@ -201,8 +201,7 @@ SPIRVPreLegalizerCombiner::SPIRVPreLegalizerCombiner()
}
bool SPIRVPreLegalizerCombiner::runOnMachineFunction(MachineFunction &MF) {
if (MF.getProperties().hasProperty(
MachineFunctionProperties::Property::FailedISel))
if (MF.getProperties().hasFailedISel())
return false;
auto &TPC = getAnalysis<TargetPassConfig>();

View File

@ -274,8 +274,7 @@ namespace {
class SPIRVInstructionSelect : public InstructionSelect {
// We don't use register banks, so unset the requirement for them
MachineFunctionProperties getRequiredProperties() const override {
return InstructionSelect::getRequiredProperties().reset(
MachineFunctionProperties::Property::RegBankSelected);
return InstructionSelect::getRequiredProperties().resetRegBankSelected();
}
};
} // namespace

View File

@ -58,8 +58,7 @@ namespace {
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
void insertCallDefsUses(MachineBasicBlock::iterator MI,

View File

@ -71,8 +71,7 @@ public:
bool runOnMachineFunction(MachineFunction &F) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
private:

View File

@ -9606,7 +9606,7 @@ static void createPHIsForSelects(SmallVector<MachineInstr*, 8> &Selects,
RegRewriteTable[DestReg] = std::make_pair(TrueReg, FalseReg);
}
MF->getProperties().reset(MachineFunctionProperties::Property::NoPHIs);
MF->getProperties().resetNoPHIs();
}
MachineBasicBlock *
@ -10560,7 +10560,7 @@ SystemZTargetLowering::emitMemMemWrapper(MachineInstr &MI,
MBB->addLiveIn(SystemZ::CC);
}
}
MF.getProperties().reset(MachineFunctionProperties::Property::NoPHIs);
MF.getProperties().resetNoPHIs();
}
// Handle any remaining bytes with straight-line code.

View File

@ -140,8 +140,7 @@ public:
bool runOnMachineFunction(MachineFunction &F) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
private:

View File

@ -31,8 +31,7 @@ public:
bool processBlock(MachineBasicBlock &MBB);
bool runOnMachineFunction(MachineFunction &F) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
private:

View File

@ -50,8 +50,7 @@ class WebAssemblyOptimizeLiveIntervals final : public MachineFunctionPass {
}
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::TracksLiveness);
return MachineFunctionProperties().setTracksLiveness();
}
bool runOnMachineFunction(MachineFunction &MF) override;

View File

@ -872,7 +872,7 @@ void X86CmovConverterPass::convertCmovInstsToBranches(
// Reset the NoPHIs property if a PHI was inserted to prevent a conflict with
// the MachineVerifier during testing.
if (MIItBegin != MIItEnd)
F->getProperties().reset(MachineFunctionProperties::Property::NoPHIs);
F->getProperties().resetNoPHIs();
// Now remove the CMOV(s).
MBB->erase(MIItBegin, MIItEnd);

View File

@ -75,8 +75,7 @@ public:
// This pass runs after regalloc and doesn't support VReg operands.
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
};

View File

@ -51,8 +51,7 @@ public:
bool runOnMachineFunction(MachineFunction &MF) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
return MachineFunctionProperties().setNoVRegs();
}
StringRef getPassName() const override {

View File

@ -62,8 +62,7 @@ public:
bool runOnMachineFunction(MachineFunction &MFunc) override;
MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoPHIs);
return MachineFunctionProperties().setNoPHIs();
}
static char ID;

Some files were not shown because too many files have changed in this diff Show More