summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshat Oke <Akshat.Oke@amd.com>2025-05-06 09:05:52 +0000
committerAkshat Oke <Akshat.Oke@amd.com>2025-07-09 08:49:20 +0000
commit6d6546da6f88c149757ae9e60351e1a2dec7126a (patch)
treeca912840c310f871acd12f4bcdfd492ba222b4d2
parentf39a6916b0c9fb444a728edc58916fe4cee3fc12 (diff)
[CodeGen][NPM] VirtRegRewriter: Set VirtReg flagusers/optimisan/set-vrr-flag
-rw-r--r--llvm/include/llvm/CodeGen/VirtRegMap.h8
-rw-r--r--llvm/lib/CodeGen/VirtRegMap.cpp2
2 files changed, 10 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/VirtRegMap.h b/llvm/include/llvm/CodeGen/VirtRegMap.h
index 5ab3f7e74223..b5f962e0fb82 100644
--- a/llvm/include/llvm/CodeGen/VirtRegMap.h
+++ b/llvm/include/llvm/CodeGen/VirtRegMap.h
@@ -251,6 +251,14 @@ public:
LLVM_ABI void printPipeline(raw_ostream &OS,
function_ref<StringRef(StringRef)>) const;
+
+ MachineFunctionProperties getSetProperties() const {
+ if (ClearVirtRegs) {
+ return MachineFunctionProperties().set(
+ MachineFunctionProperties::Property::NoVRegs);
+ }
+ return {};
+ }
};
} // end llvm namespace
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp
index 3d6ccba894e9..99ba893d6f09 100644
--- a/llvm/lib/CodeGen/VirtRegMap.cpp
+++ b/llvm/lib/CodeGen/VirtRegMap.cpp
@@ -301,6 +301,8 @@ bool VirtRegRewriterLegacy::runOnMachineFunction(MachineFunction &MF) {
PreservedAnalyses
VirtRegRewriterPass::run(MachineFunction &MF,
MachineFunctionAnalysisManager &MFAM) {
+ MFPropsModifier _(*this, MF);
+
VirtRegMap &VRM = MFAM.getResult<VirtRegMapAnalysis>(MF);
LiveIntervals &LIS = MFAM.getResult<LiveIntervalsAnalysis>(MF);
LiveRegMatrix &LRM = MFAM.getResult<LiveRegMatrixAnalysis>(MF);