Skip to content

Commit 5dceb82

Browse files
committed
[pruned-liveness] Change computeScalarUseBlockLiveness to internally sue the scalar version of markBlockLive
1 parent e6b63fb commit 5dceb82

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/SIL/Utils/PrunedLiveness.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,11 @@
2222
using namespace swift;
2323

2424
void PrunedLiveBlocks::computeScalarUseBlockLiveness(SILBasicBlock *userBB,
25-
unsigned startBitNo) {
26-
unsigned endBitNo = startBitNo + 1;
27-
25+
unsigned bitNo) {
2826
// If, we are visiting this block, then it is not already LiveOut. Mark it
2927
// LiveWithin to indicate a liveness boundary within the block.
30-
markBlockLive(userBB, startBitNo, endBitNo, LiveWithin);
28+
markBlockLive(userBB, bitNo, LiveWithin);
3129

32-
// Specialize the given code for scalar code.
3330
BasicBlockWorklist worklist(userBB->getFunction());
3431
worklist.push(userBB);
3532

@@ -39,12 +36,12 @@ void PrunedLiveBlocks::computeScalarUseBlockLiveness(SILBasicBlock *userBB,
3936
// Traversal terminates at any previously visited block, including the
4037
// blocks initialized as definition blocks.
4138
for (auto *predBlock : block->getPredecessorBlocks()) {
42-
switch (getBlockLiveness(predBlock, startBitNo)) {
39+
switch (getBlockLiveness(predBlock, bitNo)) {
4340
case Dead:
4441
worklist.pushIfNotVisited(predBlock);
4542
LLVM_FALLTHROUGH;
4643
case LiveWithin:
47-
markBlockLive(predBlock, startBitNo, endBitNo, LiveOut);
44+
markBlockLive(predBlock, bitNo, LiveOut);
4845
break;
4946
case LiveOut:
5047
break;

0 commit comments

Comments
 (0)