summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit31160f5b98f6975f759a6ba65b8e29f086536fe0 (patch)
tree33138561c67a5f11b73992cbd0d4fe6feeb4b58e /llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
parent7f8ebb73af1a1937c93903b192035c0b1b9ee09a (diff)
downloadbcm5719-llvm-31160f5b98f6975f759a6ba65b8e29f086536fe0.tar.gz
bcm5719-llvm-31160f5b98f6975f759a6ba65b8e29f086536fe0.zip
Help testing.
llvm-svn: 47448
Diffstat (limited to 'llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r--llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 7c512ed368a..86c9895ca92 100644
--- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/llvm/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();
OpenPOWER on IntegriCloud