From 304983b93e14a3f7b84c8e41f5dfc56750dba1b0 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 21 Feb 2008 19:20:21 +0000 Subject: [PATCH] Help testing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47448 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SimpleRegisterCoalescing.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 7c512ed368a..86c9895ca92 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 + CommuteLimit("commute-limit", + cl::init(-1), cl::Hidden); + RegisterPass 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(); -- 2.34.1