summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocLinearScan.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-03-23 18:24:37 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-03-23 18:24:37 +0000
commitf858466018346e3b59acb9e3ac7dfd5ba4c0d0a9 (patch)
treee4e577d0a629943609d240700b5968101a522108 /llvm/lib/CodeGen/RegAllocLinearScan.cpp
parent656711a36b2be1b2c2663f016badd59e3c3f26b3 (diff)
downloadbcm5719-llvm-f858466018346e3b59acb9e3ac7dfd5ba4c0d0a9.tar.gz
bcm5719-llvm-f858466018346e3b59acb9e3ac7dfd5ba4c0d0a9.zip
Fix PR3391 and PR3864. Reg allocator infinite looping.
llvm-svn: 67544
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocLinearScan.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
index e8296a74775..912135a57f6 100644
--- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
@@ -869,8 +869,12 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur)
if (cur->weight == HUGE_VALF ||
li_->getApproximateInstructionCount(*cur) == 0) {
// Spill a physical register around defs and uses.
- li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_);
- assignRegOrStackSlotAtInterval(cur);
+ if (li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_))
+ assignRegOrStackSlotAtInterval(cur);
+ else {
+ cerr << "Ran out of registers during register allocation!\n";
+ exit(1);
+ }
return;
}
}
OpenPOWER on IntegriCloud