Skip to content

Commit ef7a847

Browse files
authored
[LoopUnswitch] Remove redundant condition. (NFC) (#107893)
Remove redundant condition from '!A || (A && B)' to '!A || B' Fixes: #99799
1 parent 64dba97 commit ef7a847

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,8 +770,7 @@ static bool unswitchTrivialSwitch(Loop &L, SwitchInst &SI, DominatorTree &DT,
770770
// instruction in the block.
771771
auto *TI = BBToCheck.getTerminator();
772772
bool isUnreachable = isa<UnreachableInst>(TI);
773-
return !isUnreachable ||
774-
(isUnreachable && (BBToCheck.getFirstNonPHIOrDbg() != TI));
773+
return !isUnreachable || BBToCheck.getFirstNonPHIOrDbg() != TI;
775774
};
776775

777776
SmallVector<int, 4> ExitCaseIndices;

0 commit comments

Comments
 (0)