aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SimpleRegisterCoalescing.cpp
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
commitec41c7cb9747d47b1c037e353a7916fa117a4321 (patch)
treea387ac1f598b4603e975791861fa3e64a85583fa /lib/CodeGen/SimpleRegisterCoalescing.cpp
parentdd96f72d7adce5da5a3deefb10d57fb232e2cdde (diff)
downloadexternal_llvm-ec41c7cb9747d47b1c037e353a7916fa117a4321.zip
external_llvm-ec41c7cb9747d47b1c037e353a7916fa117a4321.tar.gz
external_llvm-ec41c7cb9747d47b1c037e353a7916fa117a4321.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/CodeGen/SimpleRegisterCoalescing.cpp')
-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();