aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SplitKit.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2021-08-28 10:32:29 -0400
committerMatt Arsenault <Matthew.Arsenault@amd.com>2021-09-15 17:35:59 -0400
commit87c00878d3ace60fe07cc2a9f8bd4566ab817d26 (patch)
tree57278e269be7533b54a8d2ded74647d96e1443f3 /llvm/lib/CodeGen/SplitKit.cpp
parentcb8c30d35dc9eedca4b8073e96f06e9ce8f12192 (diff)
downloadllvm-87c00878d3ace60fe07cc2a9f8bd4566ab817d26.zip
llvm-87c00878d3ace60fe07cc2a9f8bd4566ab817d26.tar.gz
llvm-87c00878d3ace60fe07cc2a9f8bd4566ab817d26.tar.bz2
SplitKit: Remove decade old live interval hack
This was trying to fixup broken live intervals coming out of the coalescer. The verifier is more complete now and no tests seem to fail without this.
Diffstat (limited to 'llvm/lib/CodeGen/SplitKit.cpp')
-rw-r--r--llvm/lib/CodeGen/SplitKit.cpp25
1 files changed, 4 insertions, 21 deletions
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp
index 38493ed..7f9518e 100644
--- a/llvm/lib/CodeGen/SplitKit.cpp
+++ b/llvm/lib/CodeGen/SplitKit.cpp
@@ -50,7 +50,6 @@ STATISTIC(NumFinished, "Number of splits finished");
STATISTIC(NumSimple, "Number of splits that were simple");
STATISTIC(NumCopies, "Number of copies inserted for splitting");
STATISTIC(NumRemats, "Number of rematerialized defs for splitting");
-STATISTIC(NumRepairs, "Number of invalid live ranges repaired");
//===----------------------------------------------------------------------===//
// Last Insert Point Analysis
@@ -160,7 +159,6 @@ void SplitAnalysis::clear() {
UseBlocks.clear();
ThroughBlocks.clear();
CurLI = nullptr;
- DidRepairRange = false;
}
/// analyzeUses - Count instructions, basic blocks, and loops using CurLI.
@@ -188,20 +186,7 @@ void SplitAnalysis::analyzeUses() {
UseSlots.end());
// Compute per-live block info.
- if (!calcLiveBlockInfo()) {
- // FIXME: calcLiveBlockInfo found inconsistencies in the live range.
- // I am looking at you, RegisterCoalescer!
- DidRepairRange = true;
- ++NumRepairs;
- LLVM_DEBUG(dbgs() << "*** Fixing inconsistent live interval! ***\n");
- const_cast<LiveIntervals&>(LIS)
- .shrinkToUses(const_cast<LiveInterval*>(CurLI));
- UseBlocks.clear();
- ThroughBlocks.clear();
- bool fixed = calcLiveBlockInfo();
- (void)fixed;
- assert(fixed && "Couldn't fix broken live interval");
- }
+ calcLiveBlockInfo();
LLVM_DEBUG(dbgs() << "Analyze counted " << UseSlots.size() << " instrs in "
<< UseBlocks.size() << " blocks, through "
@@ -210,11 +195,11 @@ void SplitAnalysis::analyzeUses() {
/// calcLiveBlockInfo - Fill the LiveBlocks array with information about blocks
/// where CurLI is live.
-bool SplitAnalysis::calcLiveBlockInfo() {
+void SplitAnalysis::calcLiveBlockInfo() {
ThroughBlocks.resize(MF.getNumBlockIDs());
NumThroughBlocks = NumGapBlocks = 0;
if (CurLI->empty())
- return true;
+ return;
LiveInterval::const_iterator LVI = CurLI->begin();
LiveInterval::const_iterator LVE = CurLI->end();
@@ -240,8 +225,7 @@ bool SplitAnalysis::calcLiveBlockInfo() {
ThroughBlocks.set(BI.MBB->getNumber());
// The range shouldn't end mid-block if there are no uses. This shouldn't
// happen.
- if (LVI->end < Stop)
- return false;
+ assert(LVI->end >= Stop && "range ends mid block with no uses");
} else {
// This block has uses. Find the first and last uses in the block.
BI.FirstInstr = *UseI;
@@ -312,7 +296,6 @@ bool SplitAnalysis::calcLiveBlockInfo() {
}
assert(getNumLiveBlocks() == countLiveBlocks(CurLI) && "Bad block count");
- return true;
}
unsigned SplitAnalysis::countLiveBlocks(const LiveInterval *cli) const {