Skip to content

Commit 6d6546d

Browse files
committed
[CodeGen][NPM] VirtRegRewriter: Set VirtReg flag
1 parent f39a691 commit 6d6546d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

llvm/include/llvm/CodeGen/VirtRegMap.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,14 @@ class VirtRegRewriterPass : public PassInfoMixin<VirtRegRewriterPass> {
251251

252252
LLVM_ABI void printPipeline(raw_ostream &OS,
253253
function_ref<StringRef(StringRef)>) const;
254+
255+
MachineFunctionProperties getSetProperties() const {
256+
if (ClearVirtRegs) {
257+
return MachineFunctionProperties().set(
258+
MachineFunctionProperties::Property::NoVRegs);
259+
}
260+
return {};
261+
}
254262
};
255263

256264
} // end llvm namespace

llvm/lib/CodeGen/VirtRegMap.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@ bool VirtRegRewriterLegacy::runOnMachineFunction(MachineFunction &MF) {
301301
PreservedAnalyses
302302
VirtRegRewriterPass::run(MachineFunction &MF,
303303
MachineFunctionAnalysisManager &MFAM) {
304+
MFPropsModifier _(*this, MF);
305+
304306
VirtRegMap &VRM = MFAM.getResult<VirtRegMapAnalysis>(MF);
305307
LiveIntervals &LIS = MFAM.getResult<LiveIntervalsAnalysis>(MF);
306308
LiveRegMatrix &LRM = MFAM.getResult<LiveRegMatrixAnalysis>(MF);

0 commit comments

Comments
 (0)