diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-10-28 01:48:24 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-10-28 01:48:24 +0000 |
commit | ae7fa5bef1bd8ff4cee120dae2e4388184410ad2 (patch) | |
tree | 43516c49916b113254774f7b6551d134c1cd77e3 /lib/CodeGen/PreAllocSplitting.cpp | |
parent | 5a9a4bf7f27d86df83544387b34543f0a8112c1d (diff) |
Add command line option to limit the number splits to help debugging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58312 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PreAllocSplitting.cpp')
-rw-r--r-- | lib/CodeGen/PreAllocSplitting.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/CodeGen/PreAllocSplitting.cpp b/lib/CodeGen/PreAllocSplitting.cpp index 5c1c2230c8..b6efe0624d 100644 --- a/lib/CodeGen/PreAllocSplitting.cpp +++ b/lib/CodeGen/PreAllocSplitting.cpp @@ -33,7 +33,9 @@ #include <map> using namespace llvm; -STATISTIC(NumSplit , "Number of intervals split"); +static cl::opt<int> PreSplitLimit("pre-split-limit", cl::init(-1), cl::Hidden); + +STATISTIC(NumSplits, "Number of intervals split"); namespace { class VISIBILITY_HIDDEN PreAllocSplitting : public MachineFunctionPass { @@ -607,7 +609,7 @@ bool PreAllocSplitting::SplitRegLiveInterval(LiveInterval *LI) { // Record val# values are in the specific spill slot. RecordSplit(CurrLI->reg, SpillIndex, RestoreIndex, SS); - ++NumSplit; + ++NumSplits; return true; } @@ -659,7 +661,7 @@ bool PreAllocSplitting::SplitRegLiveInterval(LiveInterval *LI) { // Record val# values are in the specific spill slot. RecordSplit(CurrLI->reg, SpillIndex, RestoreIndex, SS); - ++NumSplit; + ++NumSplits; return true; } @@ -689,6 +691,8 @@ PreAllocSplitting::SplitRegLiveIntervals(const TargetRegisterClass **RCs) { // Process the affected live intervals. bool Change = false; while (!Intervals.empty()) { + if (PreSplitLimit != -1 && (int)NumSplits == PreSplitLimit) + break; LiveInterval *LI = Intervals.back(); Intervals.pop_back(); Change |= SplitRegLiveInterval(LI); |