aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-02-21 19:20:21 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-02-21 19:20:21 +0000
commit304983b93e14a3f7b84c8e41f5dfc56750dba1b0 (patch)
treea387ac1f598b4603e975791861fa3e64a85583fa /lib
parent6a551e73fd0dada56542d372cedccbf86fcbaf01 (diff)
downloadexternal_llvm-304983b93e14a3f7b84c8e41f5dfc56750dba1b0.zip
external_llvm-304983b93e14a3f7b84c8e41f5dfc56750dba1b0.tar.gz
external_llvm-304983b93e14a3f7b84c8e41f5dfc56750dba1b0.tar.bz2
Help testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SimpleRegisterCoalescing.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 7c512ed..86c9895 100644
--- a/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -57,6 +57,10 @@ namespace {
CommuteDef("coalescer-commute-instrs",
cl::init(false), cl::Hidden);
+ static cl::opt<int>
+ CommuteLimit("commute-limit",
+ cl::init(-1), cl::Hidden);
+
RegisterPass<SimpleRegisterCoalescing>
X("simple-register-coalescing", "Simple Register Coalescing");
@@ -289,6 +293,9 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(LiveInterval &IntA,
if (HasOtherReachingDefs(IntA, IntB, AValNo, BValNo))
return false;
+ if (CommuteLimit >= 0 && numCommutes >= CommuteLimit)
+ return false;
+
// At this point we have decided that it is legal to do this
// transformation. Start by commuting the instruction.
MachineBasicBlock *MBB = DefMI->getParent();