Skip to content

Commit 45dec8f

Browse files
committed
[ValueTracking] Avoid known bits fallthrough for freeze (NFCI)
The known bits logic should never produce a better result than the direct recursive non-zero query here, so skip the fallthrough.
1 parent 9c0314f commit 45dec8f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2737,10 +2737,9 @@ bool isKnownNonZero(const Value *V, const APInt &DemandedElts, unsigned Depth,
27372737
}
27382738
break;
27392739
case Instruction::Freeze:
2740-
if (isKnownNonZero(I->getOperand(0), Depth, Q) &&
2741-
isGuaranteedNotToBePoison(I->getOperand(0), Q.AC, Q.CxtI, Q.DT, Depth))
2742-
return true;
2743-
break;
2740+
return isKnownNonZero(I->getOperand(0), Depth, Q) &&
2741+
isGuaranteedNotToBePoison(I->getOperand(0), Q.AC, Q.CxtI, Q.DT,
2742+
Depth);
27442743
case Instruction::Call:
27452744
if (cast<CallInst>(I)->getIntrinsicID() == Intrinsic::vscale)
27462745
return true;

0 commit comments

Comments
 (0)