#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 {
// Record val# values are in the specific spill slot.
RecordSplit(CurrLI->reg, SpillIndex, RestoreIndex, SS);
- ++NumSplit;
+ ++NumSplits;
return true;
}
// Record val# values are in the specific spill slot.
RecordSplit(CurrLI->reg, SpillIndex, RestoreIndex, SS);
- ++NumSplit;
+ ++NumSplits;
return true;
}
// 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);