Skip to content

Commit 65fd488

Browse files
committed
[field-pruned-liveness] Enable an assert when computing boundaries with the correct condition.
1 parent 3f808f7 commit 65fd488

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/SIL/Utils/FieldSensitivePrunedLiveness.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ void FieldSensitiveMultiDefPrunedLiveRange::findBoundariesInBlock(
781781
LLVM_DEBUG(llvm::dbgs() << "Has multiple defs!\n");
782782

783783
// Handle a live-out or live-within block with potentially multiple defs
784-
// unsigned prevCount = boundary.getNumLastUsersAndDeadDefs(bitNo);
784+
unsigned prevCount = boundary.getNumLastUsersAndDeadDefs(bitNo);
785785
bool isLive = isLiveOut;
786786
for (auto &inst : llvm::reverse(*block)) {
787787
LLVM_DEBUG(llvm::dbgs() << "Visiting: " << inst);
@@ -861,6 +861,7 @@ void FieldSensitiveMultiDefPrunedLiveRange::findBoundariesInBlock(
861861
<< " Live at beginning of block! No dead args!\n");
862862
}
863863

864-
// assert(prevCount < boundary.getNumLastUsersAndDeadDefs(bitNo) &&
865-
// "findBoundariesInBlock must be called on a live block");
864+
assert((isLiveOut ||
865+
prevCount < boundary.getNumLastUsersAndDeadDefs(bitNo)) &&
866+
"findBoundariesInBlock must be called on a live block");
866867
}

0 commit comments

Comments
 (0)