Skip to content

Commit fb9dd91

Browse files
committed
- fix SimplifyCFG
1 parent 39ac4a5 commit fb9dd91

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/SILOptimizer/Transforms/SimplifyCFG.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3703,10 +3703,11 @@ bool SimplifyCFG::simplifyArgument(SILBasicBlock *BB, unsigned i) {
37033703
return simplifySwitchEnumToSelectEnum(BB, i, A);
37043704

37053705
// For now, just focus on cases where there is a single use.
3706-
if (!A->hasOneUse())
3706+
SILValue argVal = lookThroughBorrowedFromUser(A);
3707+
if (!argVal->hasOneUse())
37073708
return false;
37083709

3709-
auto *Use = *lookThroughBorrowedFromUser(A)->use_begin();
3710+
auto *Use = *argVal->use_begin();
37103711
auto *User = Use->getUser();
37113712

37123713
auto disableInOSSA = [](SingleValueInstruction *inst) {

0 commit comments

Comments
 (0)