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 { LLVM_ABI void printPipeline(raw_ostream &OS, function_ref) 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(MF); LiveIntervals &LIS = MFAM.getResult(MF); LiveRegMatrix &LRM = MFAM.getResult(MF);