Oops, didn't mean to commit that.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 9 Jul 2011 01:02:44 +0000 (01:02 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 9 Jul 2011 01:02:44 +0000 (01:02 +0000)
Spills should be hoisted out of loops, but we don't want to hoist them
to dominating blocks at the same loop depth. That could cause the spills
to be executed more often.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134782 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/InlineSpiller.cpp

index 44e87ae97235d09b5552e8388ce3d57af9a7949c..5547f735ba5eaf2ba64fd6c394bd4078a5bf4ec8 100644 (file)
@@ -344,7 +344,7 @@ MachineInstr *InlineSpiller::traceSiblingValue(unsigned UseReg, VNInfo *UseVNI,
         // This is a valid spill location dominating UseVNI.
         // Prefer to spill at a smaller loop depth.
         unsigned Depth = Loops.getLoopDepth(MBB);
-        if (Depth <= SpillDepth) {
+        if (Depth < SpillDepth) {
           DEBUG(dbgs() << "  spill depth " << Depth << ": " << PrintReg(Reg)
                        << ':' << VNI->id << '@' << VNI->def << '\n');
           SVI.SpillReg = Reg;