[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292372 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Florian Hahn 2017-01-18 15:01:22 +00:00
parent c2e261218f
commit 4a5b076253
2 changed files with 6 additions and 0 deletions

View File

@ -1237,4 +1237,6 @@ doScavengeFrameVirtualRegs(MachineFunction &MF, RegScavenger *RS) {
++I;
}
}
MF.getProperties().set(MachineFunctionProperties::Property::NoVRegs);
}

View File

@ -347,6 +347,10 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF,
// checks for hasVarSizedObjects.
if (MFI.hasVarSizedObjects())
AFI->setShouldRestoreSPFromFP(true);
// In some cases, virtual registers have been introduced, e.g. by uses of
// emitThumbRegPlusImmInReg.
MF.getProperties().reset(MachineFunctionProperties::Property::NoVRegs);
}
static bool isCSRestore(MachineInstr &MI, const MCPhysReg *CSRegs) {