diff options
| author | Lang Hames <lhames@gmail.com> | 2009-11-15 04:39:51 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2009-11-15 04:39:51 +0000 |
| commit | 6da915ac865084e35452b3b6cb71cd0d721e4c33 (patch) | |
| tree | 17923bdade06f30712f4b3a7463898a9e240571c /llvm/lib/CodeGen/RegAllocPBQP.cpp | |
| parent | 4c808dfc583efb124ee7a309b48713f862ed45ce (diff) | |
| download | bcm5719-llvm-6da915ac865084e35452b3b6cb71cd0d721e4c33.tar.gz bcm5719-llvm-6da915ac865084e35452b3b6cb71cd0d721e4c33.zip | |
Added an assert to the PBQP allocator to catch infinite cost solutions which might otherwise lead to miscompilations.
llvm-svn: 88829
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocPBQP.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocPBQP.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAllocPBQP.cpp b/llvm/lib/CodeGen/RegAllocPBQP.cpp index 5757e475546..c677d341bef 100644 --- a/llvm/lib/CodeGen/RegAllocPBQP.cpp +++ b/llvm/lib/CodeGen/RegAllocPBQP.cpp @@ -693,6 +693,11 @@ void PBQPRegAlloc::addStackInterval(const LiveInterval *spilled, } bool PBQPRegAlloc::mapPBQPToRegAlloc(const PBQP::Solution &solution) { + + // Assert that this is a valid solution to the regalloc problem. + assert(solution.getCost() != std::numeric_limits<PBQP::PBQPNum>::infinity() && + "Invalid (infinite cost) solution for PBQP problem."); + // Set to true if we have any spills bool anotherRoundNeeded = false; |

