Skip to content

Commit 18be363

Browse files
committed
[NFC][CodeGen] Adopt MachineFunctionProperties convienence accessors
1 parent 1fdf02a commit 18be363

File tree

115 files changed

+136
-267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+136
-267
lines changed

llvm/include/llvm/CodeGen/MachineFunction.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ class MachineFunctionProperties {
239239
return *this;
240240
}
241241

242+
// Set all the properties.
243+
MachineFunctionProperties &set() {
244+
Properties.set();
245+
return *this;
246+
}
247+
242248
MachineFunctionProperties &set(const MachineFunctionProperties &MFP) {
243249
Properties |= MFP.Properties;
244250
return *this;

llvm/include/llvm/CodeGen/PeepholeOptimizer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ class PeepholeOptimizerPass : public PassInfoMixin<PeepholeOptimizerPass> {
1919
MachineFunctionAnalysisManager &MFAM);
2020

2121
MachineFunctionProperties getRequiredProperties() const {
22-
return MachineFunctionProperties().set(
23-
MachineFunctionProperties::Property::IsSSA);
22+
return MachineFunctionProperties().setIsSSA();
2423
}
2524
};
2625

llvm/lib/Passes/PassBuilder.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ class TriggerVerifierErrorPass
447447
// Intentionally create a virtual register and set NoVRegs property.
448448
auto &MRI = MF.getRegInfo();
449449
MRI.createGenericVirtualRegister(LLT::scalar(8));
450-
MF.getProperties().set(MachineFunctionProperties::Property::NoVRegs);
450+
MF.getProperties().setNoVRegs();
451451
return PreservedAnalyses::all();
452452
}
453453

@@ -465,19 +465,7 @@ class RequireAllMachineFunctionPropertiesPass
465465
}
466466

467467
static MachineFunctionProperties getRequiredProperties() {
468-
MachineFunctionProperties MFProps;
469-
MFProps.set(MachineFunctionProperties::Property::FailedISel);
470-
MFProps.set(MachineFunctionProperties::Property::FailsVerification);
471-
MFProps.set(MachineFunctionProperties::Property::IsSSA);
472-
MFProps.set(MachineFunctionProperties::Property::Legalized);
473-
MFProps.set(MachineFunctionProperties::Property::NoPHIs);
474-
MFProps.set(MachineFunctionProperties::Property::NoVRegs);
475-
MFProps.set(MachineFunctionProperties::Property::RegBankSelected);
476-
MFProps.set(MachineFunctionProperties::Property::Selected);
477-
MFProps.set(MachineFunctionProperties::Property::TiedOpsRewritten);
478-
MFProps.set(MachineFunctionProperties::Property::TracksDebugUserValues);
479-
MFProps.set(MachineFunctionProperties::Property::TracksLiveness);
480-
return MFProps;
468+
return MachineFunctionProperties().set();
481469
}
482470
static StringRef name() { return "RequireAllMachineFunctionPropertiesPass"; }
483471
};

llvm/lib/Target/AArch64/AArch64A53Fix835769.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ class AArch64A53Fix835769 : public MachineFunctionPass {
8686
bool runOnMachineFunction(MachineFunction &F) override;
8787

8888
MachineFunctionProperties getRequiredProperties() const override {
89-
return MachineFunctionProperties().set(
90-
MachineFunctionProperties::Property::NoVRegs);
89+
return MachineFunctionProperties().setNoVRegs();
9190
}
9291

9392
StringRef getPassName() const override {

llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ class AArch64A57FPLoadBalancing : public MachineFunctionPass {
117117
bool runOnMachineFunction(MachineFunction &F) override;
118118

119119
MachineFunctionProperties getRequiredProperties() const override {
120-
return MachineFunctionProperties().set(
121-
MachineFunctionProperties::Property::NoVRegs);
120+
return MachineFunctionProperties().setNoVRegs();
122121
}
123122

124123
StringRef getPassName() const override {

llvm/lib/Target/AArch64/AArch64CollectLOH.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ struct AArch64CollectLOH : public MachineFunctionPass {
132132
bool runOnMachineFunction(MachineFunction &MF) override;
133133

134134
MachineFunctionProperties getRequiredProperties() const override {
135-
return MachineFunctionProperties().set(
136-
MachineFunctionProperties::Property::NoVRegs);
135+
return MachineFunctionProperties().setNoVRegs();
137136
}
138137

139138
StringRef getPassName() const override { return AARCH64_COLLECT_LOH_NAME; }

llvm/lib/Target/AArch64/AArch64CompressJumpTables.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ class AArch64CompressJumpTables : public MachineFunctionPass {
5252
bool runOnMachineFunction(MachineFunction &MF) override;
5353

5454
MachineFunctionProperties getRequiredProperties() const override {
55-
return MachineFunctionProperties().set(
56-
MachineFunctionProperties::Property::NoVRegs);
55+
return MachineFunctionProperties().setNoVRegs();
5756
}
5857
StringRef getPassName() const override {
5958
return "AArch64 Compress Jump Tables";

llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ class FalkorHWPFFix : public MachineFunctionPass {
188188
}
189189

190190
MachineFunctionProperties getRequiredProperties() const override {
191-
return MachineFunctionProperties().set(
192-
MachineFunctionProperties::Property::NoVRegs);
191+
return MachineFunctionProperties().setNoVRegs();
193192
}
194193

195194
private:

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ let RecomputePerFunction = 1 in {
11211121
// SelectionDAG's behaviour.
11221122
// FIXME: One day there will probably be a nicer way to check for this, but
11231123
// today is not that day.
1124-
def OptimizedGISelOrOtherSelector : Predicate<"!MF->getFunction().hasOptNone() || MF->getProperties().hasProperty(MachineFunctionProperties::Property::FailedISel) || !MF->getProperties().hasProperty(MachineFunctionProperties::Property::Legalized)">;
1124+
def OptimizedGISelOrOtherSelector : Predicate<"!MF->getFunction().hasOptNone() || MF->getProperties().hasFailedISel() || !MF->getProperties().hasLegalized()">;
11251125
}
11261126

11271127
include "AArch64InstrFormats.td"

llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ struct AArch64LoadStoreOpt : public MachineFunctionPass {
233233
bool runOnMachineFunction(MachineFunction &Fn) override;
234234

235235
MachineFunctionProperties getRequiredProperties() const override {
236-
return MachineFunctionProperties().set(
237-
MachineFunctionProperties::Property::NoVRegs);
236+
return MachineFunctionProperties().setNoVRegs();
238237
}
239238

240239
StringRef getPassName() const override { return AARCH64_LOAD_STORE_OPT_NAME; }

0 commit comments

Comments
 (0)