Add a debugging option for SSC DCE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65375 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2009-02-24 05:44:18 +00:00
parent 5aa4977fba
commit 3d8bde8dfb

View File

@ -37,6 +37,8 @@ EnableDCE("enable-ssc-dce",
cl::init(false), cl::Hidden,
cl::desc("Enable slot coloring DCE"));
static cl::opt<int> DCELimit("ssc-dce-limit", cl::init(-1), cl::Hidden);
STATISTIC(NumEliminated, "Number of stack slots eliminated due to coloring");
STATISTIC(NumDeadAccesses,
"Number of trivially dead stack accesses eliminated");
@ -286,6 +288,9 @@ bool StackSlotColoring::removeDeadStores(MachineBasicBlock* MBB) {
for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
I != E; ++I) {
if (DCELimit != -1 && (int)NumDeadAccesses >= DCELimit)
break;
MachineBasicBlock::iterator NextMI = next(I);
if (NextMI == MBB->end()) continue;