]> granicus.if.org Git - llvm/commitdiff
[thumb,framelowering] Reset NoVRegs in Thumb1FrameLowering::emitPrologue.
authorFlorian Hahn <florian.hahn@arm.com>
Wed, 18 Jan 2017 15:01:22 +0000 (15:01 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Wed, 18 Jan 2017 15:01:22 +0000 (15:01 +0000)
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

lib/CodeGen/PrologEpilogInserter.cpp
lib/Target/ARM/Thumb1FrameLowering.cpp

index 5fca7fa5536b5a2f75e76bb76d3e64646080298f..708f95c55b265c851b3ce3f4db10513534462a64 100644 (file)
@@ -1237,4 +1237,6 @@ doScavengeFrameVirtualRegs(MachineFunction &MF, RegScavenger *RS) {
         ++I;
     }
   }
+
+  MF.getProperties().set(MachineFunctionProperties::Property::NoVRegs);
 }
index 1103532075afb618f6a3d373f41d36981f6e72bf..3cfe61b738d45b46fb4da7715cde068bf7a7dee9 100644 (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) {