Skip to content

Commit d32c6c4

Browse files
committed
[CodeGen][NPM] VirtRegRewriter: Set VirtReg flag
1 parent 72ba54e commit d32c6c4

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
@@ -248,6 +248,14 @@ class VirtRegRewriterPass : public PassInfoMixin<VirtRegRewriterPass> {
248248
static bool isRequired() { return true; }
249249

250250
void printPipeline(raw_ostream &OS, function_ref<StringRef(StringRef)>) const;
251+
252+
MachineFunctionProperties getSetProperties() const {
253+
if (ClearVirtRegs) {
254+
return MachineFunctionProperties().set(
255+
MachineFunctionProperties::Property::NoVRegs);
256+
}
257+
return {};
258+
}
251259
};
252260

253261
} // end llvm namespace

llvm/lib/CodeGen/VirtRegMap.cpp

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

0 commit comments

Comments
 (0)