-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a8ed7d2
to
5293b37
Compare
@llvm/pr-subscribers-backend-amdgpu Author: Akshat Oke (optimisan) ChangesMakes them congruent with the legacy PM methods. Unless it was made non-const on purpose: was it? Full diff: https://github.com/llvm/llvm-project/pull/113304.diff 4 Files Affected:
diff --git a/llvm/include/llvm/CodeGen/MachinePassManager.h b/llvm/include/llvm/CodeGen/MachinePassManager.h
index 253fabdac0019d..69b5f6e92940c4 100644
--- a/llvm/include/llvm/CodeGen/MachinePassManager.h
+++ b/llvm/include/llvm/CodeGen/MachinePassManager.h
@@ -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>) {
@@ -71,7 +71,7 @@ template <typename PassT> class MFPropsModifier {
}
private:
- PassT &P;
+ const PassT &P;
MachineFunction &MF;
template <typename T>
diff --git a/llvm/include/llvm/CodeGen/RegAllocFast.h b/llvm/include/llvm/CodeGen/RegAllocFast.h
index c99c715daacf96..440264a06ae89e 100644
--- a/llvm/include/llvm/CodeGen/RegAllocFast.h
+++ b/llvm/include/llvm/CodeGen/RegAllocFast.h
@@ -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);
@@ -41,7 +41,7 @@ class RegAllocFastPass : public PassInfoMixin<RegAllocFastPass> {
return MachineFunctionProperties();
}
- MachineFunctionProperties getClearedProperties() {
+ MachineFunctionProperties getClearedProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
}
diff --git a/llvm/include/llvm/CodeGen/TwoAddressInstructionPass.h b/llvm/include/llvm/CodeGen/TwoAddressInstructionPass.h
index 7f2a070c584347..d4d47f29cc8446 100644
--- a/llvm/include/llvm/CodeGen/TwoAddressInstructionPass.h
+++ b/llvm/include/llvm/CodeGen/TwoAddressInstructionPass.h
@@ -18,7 +18,7 @@ class TwoAddressInstructionPass
public:
PreservedAnalyses run(MachineFunction &MF,
MachineFunctionAnalysisManager &MFAM);
- MachineFunctionProperties getSetProperties() {
+ MachineFunctionProperties getSetProperties() const {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::TiedOpsRewritten);
}
diff --git a/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.h b/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.h
index 730b3f8c617bd3..a9ffb5705d094a 100644
--- a/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.h
+++ b/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.h
@@ -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)
|
5293b37
to
a96dde6
Compare
Makes them congruent with the legacy PM methods.
a96dde6
to
72384e9
Compare
paperchalice
approved these changes
Oct 24, 2024
Closed
NoumanAmir657
pushed a commit
to NoumanAmir657/llvm-project
that referenced
this pull request
Nov 4, 2024
Makes them congruent with the legacy PM methods.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Makes them congruent with the legacy PM methods.
Unless it was made non-const on purpose: was it?