Skip to content

[CodeGen][NewPM] Make MFProperties methods const NFC #113304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGen/MachineCSE.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MachineCSEPass : public PassInfoMixin<MachineCSEPass> {
PreservedAnalyses run(MachineFunction &MF,
MachineFunctionAnalysisManager &MFAM);

MachineFunctionProperties getRequiredProperties() {
MachineFunctionProperties getRequiredProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
}
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/CodeGen/MachinePassManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ using MachineFunctionAnalysisManager = AnalysisManager<MachineFunction>;
/// MachineFunctionProperties properly.
template <typename PassT> class MFPropsModifier {
public:
MFPropsModifier(PassT &P_, MachineFunction &MF_) : P(P_), MF(MF_) {
MFPropsModifier(const PassT &P_, MachineFunction &MF_) : P(P_), MF(MF_) {
auto &MFProps = MF.getProperties();
#ifndef NDEBUG
if constexpr (has_get_required_properties_v<PassT>) {
Expand Down Expand Up @@ -71,7 +71,7 @@ template <typename PassT> class MFPropsModifier {
}

private:
PassT &P;
const PassT &P;
MachineFunction &MF;

template <typename T>
Expand Down
6 changes: 3 additions & 3 deletions llvm/include/llvm/CodeGen/RegAllocFast.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class RegAllocFastPass : public PassInfoMixin<RegAllocFastPass> {
RegAllocFastPass(RegAllocFastPassOptions Opts = RegAllocFastPassOptions())
: Opts(Opts) {}

MachineFunctionProperties getRequiredProperties() {
MachineFunctionProperties getRequiredProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoPHIs);
}

MachineFunctionProperties getSetProperties() {
MachineFunctionProperties getSetProperties() const {
if (Opts.ClearVRegs) {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::NoVRegs);
Expand All @@ -41,7 +41,7 @@ class RegAllocFastPass : public PassInfoMixin<RegAllocFastPass> {
return MachineFunctionProperties();
}

MachineFunctionProperties getClearedProperties() {
MachineFunctionProperties getClearedProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGen/TwoAddressInstructionPass.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TwoAddressInstructionPass
public:
PreservedAnalyses run(MachineFunction &MF,
MachineFunctionAnalysisManager &MFAM);
MachineFunctionProperties getSetProperties() {
MachineFunctionProperties getSetProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::TiedOpsRewritten);
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/GCNDPPCombine.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class GCNDPPCombinePass : public PassInfoMixin<GCNDPPCombinePass> {
PreservedAnalyses run(MachineFunction &MF,
MachineFunctionAnalysisManager &MAM);

MachineFunctionProperties getRequiredProperties() {
MachineFunctionProperties getRequiredProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SILoadStoreOptimizerPass
PreservedAnalyses run(MachineFunction &MF,
MachineFunctionAnalysisManager &MFAM);

MachineFunctionProperties getRequiredProperties() {
MachineFunctionProperties getRequiredProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/SILowerSGPRSpills.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SILowerSGPRSpillsPass : public PassInfoMixin<SILowerSGPRSpillsPass> {
PreservedAnalyses run(MachineFunction &MF,
MachineFunctionAnalysisManager &MFAM);

MachineFunctionProperties getClearedProperties() {
MachineFunctionProperties getClearedProperties() const {
// SILowerSGPRSpills introduces new Virtual VGPRs for spilling SGPRs.
return MachineFunctionProperties()
.set(MachineFunctionProperties::Property::IsSSA)
Expand Down
Loading