Skip to content

Commit 62901c2

Browse files
committed
Fixes to reflect that we now consider a SILPhiArgument in a trivially dead block as a phi
With f9861ec we consider SILPhiArgument in a block with no predecessors as phis, remove assert that we expect non-empt predecessors to reflect this change.
1 parent 0c29ebb commit 62901c2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/SIL/IR/SILArgument.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ bool SILPhiArgument::getIncomingPhiOperands(
175175
return false;
176176

177177
const auto *parentBlock = getParent();
178-
assert(!parentBlock->pred_empty());
179178

180179
unsigned argIndex = getIndex();
181180
for (auto *predBlock : getParent()->getPredecessorBlocks()) {

lib/SIL/Verifier/SILOwnershipVerifier.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,10 @@ bool SILValueOwnershipChecker::isSubobjectProjectionWithLifetimeEndingUses(
620620
bool SILValueOwnershipChecker::
621621
hasGuaranteedForwardingIncomingPhiOperandsOnZeroOrAllPaths(
622622
SILPhiArgument *phi) const {
623+
// For a phi in a trivially dead block, return true.
624+
if (phi->getParentBlock()->pred_empty()) {
625+
return true;
626+
}
623627
bool foundGuaranteedForwardingPhiOperand = false;
624628
bool foundNonGuaranteedForwardingPhiOperand = false;
625629
phi->visitTransitiveIncomingPhiOperands([&](auto *, auto *operand) -> bool {

0 commit comments

Comments
 (0)