Skip to content

Commit 01967e2

Browse files
authored
[AMDGPU] Shrink a live interval instead of recomputing it. NFCI. (#108171)
1 parent 6ffa7cd commit 01967e2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,13 +1527,18 @@ bool SIWholeQuadMode::lowerCopyInstrs() {
15271527
for (MachineInstr *MI : LowerToCopyInstrs) {
15281528
LLVM_DEBUG(dbgs() << "simplify: " << *MI);
15291529

1530-
Register RecomputeReg = 0;
15311530
if (MI->getOpcode() == AMDGPU::V_SET_INACTIVE_B32 ||
15321531
MI->getOpcode() == AMDGPU::V_SET_INACTIVE_B64) {
15331532
assert(MI->getNumExplicitOperands() == 3);
1533+
1534+
LiveInterval *RecomputeLI = nullptr;
15341535
if (MI->getOperand(2).isReg())
1535-
RecomputeReg = MI->getOperand(2).getReg();
1536+
RecomputeLI = &LIS->getInterval(MI->getOperand(2).getReg());
1537+
15361538
MI->removeOperand(2);
1539+
1540+
if (RecomputeLI)
1541+
LIS->shrinkToUses(RecomputeLI);
15371542
} else {
15381543
assert(MI->getNumExplicitOperands() == 2);
15391544
}
@@ -1550,11 +1555,6 @@ bool SIWholeQuadMode::lowerCopyInstrs() {
15501555

15511556
MI->setDesc(TII->get(CopyOp));
15521557
LLVM_DEBUG(dbgs() << " -> " << *MI);
1553-
1554-
if (RecomputeReg) {
1555-
LIS->removeInterval(RecomputeReg);
1556-
LIS->createAndComputeVirtRegInterval(RecomputeReg);
1557-
}
15581558
}
15591559
return !LowerToCopyInstrs.empty() || !LowerToMovInstrs.empty();
15601560
}

0 commit comments

Comments
 (0)