From aef38c4f351b03131ab66e960a7501c2c6bc1783 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Sat, 9 Jul 2011 01:02:44 +0000 Subject: [PATCH] Oops, didn't mean to commit that. 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. llvm-svn: 134782 --- lib/CodeGen/InlineSpiller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CodeGen/InlineSpiller.cpp b/lib/CodeGen/InlineSpiller.cpp index 44e87ae9723..5547f735ba5 100644 --- a/lib/CodeGen/InlineSpiller.cpp +++ b/lib/CodeGen/InlineSpiller.cpp @@ -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;