Added an option to have the PBQP allocator attempt coalescing during allocation.
[oota-llvm.git] / lib / CodeGen / RegAllocPBQP.cpp
index 3da25533772c646eb50135d7569a5193231526d2..227ce391e54d32ade5b3f4a46a3ad3b58a586f8b 100644 (file)
@@ -59,6 +59,11 @@ static RegisterRegAlloc
 registerPBQPRepAlloc("pbqp", "PBQP register allocator.",
                       llvm::createPBQPRegisterAllocator);
 
+static cl::opt<bool>
+pbqpCoalescing("pbqp-coalescing",
+               cl::desc("Attempt coalescing during PBQP register allocation."),
+               cl::init(false), cl::Hidden);
+
 namespace {
 
   ///
@@ -537,7 +542,11 @@ PBQP::SimpleGraph PBQPRegAlloc::constructPBQPProblem() {
   }
 
   // Get the set of potential coalesces.
-  CoalesceMap coalesces;//(findCoalesces());
+  CoalesceMap coalesces;
+
+  if (pbqpCoalescing) {
+    coalesces = findCoalesces();
+  }
 
   // Construct a PBQP solver for this problem
   PBQP::SimpleGraph problem;