Add experimental -disable-physical-join command line option.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 31 Aug 2010 01:27:49 +0000 (01:27 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 31 Aug 2010 01:27:49 +0000 (01:27 +0000)
Eventually, we want to disable physreg coalescing completely, and let the
register allocator do its job using hints.

This option makes it possible to measure the impact of disabling physreg
coalescing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112567 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SimpleRegisterCoalescing.cpp

index 34c484103cfc5b311ee232432c0990c670ca89d5..5dd5fdb7b1595105ab968ae707c1083159c0176f 100644 (file)
@@ -59,6 +59,11 @@ DisableCrossClassJoin("disable-cross-class-join",
                cl::desc("Avoid coalescing cross register class copies"),
                cl::init(false), cl::Hidden);
 
+static cl::opt<bool>
+DisablePhysicalJoin("disable-physical-join",
+               cl::desc("Avoid coalescing physical register copies"),
+               cl::init(false), cl::Hidden);
+
 INITIALIZE_AG_PASS(SimpleRegisterCoalescing, RegisterCoalescer,
                 "simple-register-coalescing", "Simple Register Coalescing", 
                 false, false, true);
@@ -1036,6 +1041,11 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) {
     return false;  // Not coalescable.
   }
 
+  if (DisablePhysicalJoin && CP.isPhys()) {
+    DEBUG(dbgs() << "\tPhysical joins disabled.\n");
+    return false;
+  }
+
   DEBUG(dbgs() << "\tConsidering merging %reg" << CP.getSrcReg());
 
   // Enforce policies.