[llvm-commits] [llvm] r88829 - /llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp

Lang Hames lhames at gmail.com
Sat Nov 14 20:39:56 PST 2009


Author: lhames
Date: Sat Nov 14 22:39:51 2009
New Revision: 88829

URL: http://llvm.org/viewvc/llvm-project?rev=88829&view=rev
Log:
Added an assert to the PBQP allocator to catch infinite cost solutions which might otherwise lead to miscompilations.

Modified:
    llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp

Modified: llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp?rev=88829&r1=88828&r2=88829&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocPBQP.cpp Sat Nov 14 22:39:51 2009
@@ -693,6 +693,11 @@
 }
 
 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;
 





More information about the llvm-commits mailing list