Skip to content

Commit 789fdd5

Browse files
authored
[CodeGen][NewPM] Make MFProperties methods const NFC (#113304)
Makes them congruent with the legacy PM methods.
1 parent 99a52f9 commit 789fdd5

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

llvm/include/llvm/CodeGen/MachineCSE.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class MachineCSEPass : public PassInfoMixin<MachineCSEPass> {
1818
PreservedAnalyses run(MachineFunction &MF,
1919
MachineFunctionAnalysisManager &MFAM);
2020

21-
MachineFunctionProperties getRequiredProperties() {
21+
MachineFunctionProperties getRequiredProperties() const {
2222
return MachineFunctionProperties().set(
2323
MachineFunctionProperties::Property::IsSSA);
2424
}

llvm/include/llvm/CodeGen/MachinePassManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ using MachineFunctionAnalysisManager = AnalysisManager<MachineFunction>;
4141
/// MachineFunctionProperties properly.
4242
template <typename PassT> class MFPropsModifier {
4343
public:
44-
MFPropsModifier(PassT &P_, MachineFunction &MF_) : P(P_), MF(MF_) {
44+
MFPropsModifier(const PassT &P_, MachineFunction &MF_) : P(P_), MF(MF_) {
4545
auto &MFProps = MF.getProperties();
4646
#ifndef NDEBUG
4747
if constexpr (has_get_required_properties_v<PassT>) {
@@ -71,7 +71,7 @@ template <typename PassT> class MFPropsModifier {
7171
}
7272

7373
private:
74-
PassT &P;
74+
const PassT &P;
7575
MachineFunction &MF;
7676

7777
template <typename T>

llvm/include/llvm/CodeGen/RegAllocFast.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ class RegAllocFastPass : public PassInfoMixin<RegAllocFastPass> {
2727
RegAllocFastPass(RegAllocFastPassOptions Opts = RegAllocFastPassOptions())
2828
: Opts(Opts) {}
2929

30-
MachineFunctionProperties getRequiredProperties() {
30+
MachineFunctionProperties getRequiredProperties() const {
3131
return MachineFunctionProperties().set(
3232
MachineFunctionProperties::Property::NoPHIs);
3333
}
3434

35-
MachineFunctionProperties getSetProperties() {
35+
MachineFunctionProperties getSetProperties() const {
3636
if (Opts.ClearVRegs) {
3737
return MachineFunctionProperties().set(
3838
MachineFunctionProperties::Property::NoVRegs);
@@ -41,7 +41,7 @@ class RegAllocFastPass : public PassInfoMixin<RegAllocFastPass> {
4141
return MachineFunctionProperties();
4242
}
4343

44-
MachineFunctionProperties getClearedProperties() {
44+
MachineFunctionProperties getClearedProperties() const {
4545
return MachineFunctionProperties().set(
4646
MachineFunctionProperties::Property::IsSSA);
4747
}

llvm/include/llvm/CodeGen/TwoAddressInstructionPass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class TwoAddressInstructionPass
1818
public:
1919
PreservedAnalyses run(MachineFunction &MF,
2020
MachineFunctionAnalysisManager &MFAM);
21-
MachineFunctionProperties getSetProperties() {
21+
MachineFunctionProperties getSetProperties() const {
2222
return MachineFunctionProperties().set(
2323
MachineFunctionProperties::Property::TiedOpsRewritten);
2424
}

llvm/lib/Target/AMDGPU/GCNDPPCombine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class GCNDPPCombinePass : public PassInfoMixin<GCNDPPCombinePass> {
1717
PreservedAnalyses run(MachineFunction &MF,
1818
MachineFunctionAnalysisManager &MAM);
1919

20-
MachineFunctionProperties getRequiredProperties() {
20+
MachineFunctionProperties getRequiredProperties() const {
2121
return MachineFunctionProperties().set(
2222
MachineFunctionProperties::Property::IsSSA);
2323
}

llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SILoadStoreOptimizerPass
1919
PreservedAnalyses run(MachineFunction &MF,
2020
MachineFunctionAnalysisManager &MFAM);
2121

22-
MachineFunctionProperties getRequiredProperties() {
22+
MachineFunctionProperties getRequiredProperties() const {
2323
return MachineFunctionProperties().set(
2424
MachineFunctionProperties::Property::IsSSA);
2525
}

llvm/lib/Target/AMDGPU/SILowerSGPRSpills.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SILowerSGPRSpillsPass : public PassInfoMixin<SILowerSGPRSpillsPass> {
1717
PreservedAnalyses run(MachineFunction &MF,
1818
MachineFunctionAnalysisManager &MFAM);
1919

20-
MachineFunctionProperties getClearedProperties() {
20+
MachineFunctionProperties getClearedProperties() const {
2121
// SILowerSGPRSpills introduces new Virtual VGPRs for spilling SGPRs.
2222
return MachineFunctionProperties()
2323
.set(MachineFunctionProperties::Property::IsSSA)

0 commit comments

Comments
 (0)