Skip to content

Commit 8485cec

Browse files
committedJan 18, 2017
[thumb,framelowering] Reset NoVRegs in Thumb1FrameLowering::emitPrologue.
Summary: In this function, virtual registers can be introduced (for example through calls to emitThumbRegPlusImmInReg). doScavengeFrameVirtualRegs will replace those virtual registers with concrete registers later on in PrologEpilogInserter, which sets NoVRegs again. This patch fixes the Codegen/Thumb/segmented-stacks.ll test case which failed with expensive checks. https://llvm.org/bugs/show_bug.cgi?id=27484 Reviewers: rnk, bkramer, olista01 Reviewed By: olista01 Subscribers: llvm-commits, rengolin Differential Revision: https://reviews.llvm.org/D28829 llvm-svn: 292372
1 parent fe2c0ed commit 8485cec

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
 

‎llvm/lib/CodeGen/PrologEpilogInserter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,4 +1237,6 @@ doScavengeFrameVirtualRegs(MachineFunction &MF, RegScavenger *RS) {
12371237
++I;
12381238
}
12391239
}
1240+
1241+
MF.getProperties().set(MachineFunctionProperties::Property::NoVRegs);
12401242
}

‎llvm/lib/Target/ARM/Thumb1FrameLowering.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF,
347347
// checks for hasVarSizedObjects.
348348
if (MFI.hasVarSizedObjects())
349349
AFI->setShouldRestoreSPFromFP(true);
350+
351+
// In some cases, virtual registers have been introduced, e.g. by uses of
352+
// emitThumbRegPlusImmInReg.
353+
MF.getProperties().reset(MachineFunctionProperties::Property::NoVRegs);
350354
}
351355

352356
static bool isCSRestore(MachineInstr &MI, const MCPhysReg *CSRegs) {

0 commit comments

Comments
 (0)
Please sign in to comment.