diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-04 19:33:07 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-04 19:33:07 +0000 |
commit | fefe6ebc73589952256d62a46e2e2136c022dc19 (patch) | |
tree | 7e07b3d6446c161ebce32506c9a3650c068f052a /llvm/lib/CodeGen/RegAllocGreedy.cpp | |
parent | 768f2809f21469df9bf6620acdd85571d4c92fce (diff) | |
download | bcm5719-llvm-fefe6ebc73589952256d62a46e2e2136c022dc19.tar.gz bcm5719-llvm-fefe6ebc73589952256d62a46e2e2136c022dc19.zip |
Verify that one of the ranges produced by region splitting is allocatable.
We should not be attempting a region split if it won't lead to at least one
directly allocatable interval. That could cause infinite splitting loops.
llvm-svn: 124893
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocGreedy.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp index 2c772a20975..f478d76bf79 100644 --- a/llvm/lib/CodeGen/RegAllocGreedy.cpp +++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp @@ -812,8 +812,22 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg, // separate into connected components. Some components may be allocatable. SE.finish(); - if (VerifyEnabled) + if (VerifyEnabled) { MF->verify(this, "After splitting live range around region"); + +#ifndef NDEBUG + // Make sure that at least one of the new intervals can allocate to PhysReg. + // That was the whole point of splitting the live range. + bool found = false; + for (LiveRangeEdit::iterator I = LREdit.begin(), E = LREdit.end(); I != E; + ++I) + if (!checkUncachedInterference(**I, PhysReg)) { + found = true; + break; + } + assert(found && "No allocatable intervals after pointless splitting"); +#endif + } } unsigned RAGreedy::tryRegionSplit(LiveInterval &VirtReg, AllocationOrder &Order, |