[llvm-branch-commits] [llvm] [CodeGen][NPM] VirtRegRewriter: Set VirtReg flag (PR #148107)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jul 10 23:49:12 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-regalloc
Author: Vikram Hegde (vikramRH)
<details>
<summary>Changes</summary>
same as https://github.com/llvm/llvm-project/pull/138660,
Authored by @<!-- -->optimisan
---
Full diff: https://github.com/llvm/llvm-project/pull/148107.diff
2 Files Affected:
- (modified) llvm/include/llvm/CodeGen/VirtRegMap.h (+8)
- (modified) llvm/lib/CodeGen/VirtRegMap.cpp (+2)
``````````diff
diff --git a/llvm/include/llvm/CodeGen/VirtRegMap.h b/llvm/include/llvm/CodeGen/VirtRegMap.h
index 5ab3f7e742230..b5f962e0fb821 100644
--- a/llvm/include/llvm/CodeGen/VirtRegMap.h
+++ b/llvm/include/llvm/CodeGen/VirtRegMap.h
@@ -251,6 +251,14 @@ class VirtRegRewriterPass : public PassInfoMixin<VirtRegRewriterPass> {
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 3d6ccba894e9c..99ba893d6f096 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);
``````````
</details>
https://github.com/llvm/llvm-project/pull/148107
More information about the llvm-branch-commits
mailing list