From: Nikita Popov Date: Tue, 4 Oct 2022 09:02:31 +0000 (+0200) Subject: [ValueTracking] Avoid known bits fallthrough for freeze (NFCI) X-Git-Tag: upstream/17.0.6~31685 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45dec8f5fdd82cf1ed456b0fa860774a26c0acca;p=platform%2Fupstream%2Fllvm.git [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. --- diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index e7c7d63..81f606f 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -2737,10 +2737,9 @@ bool isKnownNonZero(const Value *V, const APInt &DemandedElts, unsigned Depth, } break; case Instruction::Freeze: - if (isKnownNonZero(I->getOperand(0), Depth, Q) && - isGuaranteedNotToBePoison(I->getOperand(0), Q.AC, Q.CxtI, Q.DT, Depth)) - return true; - break; + return isKnownNonZero(I->getOperand(0), Depth, Q) && + isGuaranteedNotToBePoison(I->getOperand(0), Q.AC, Q.CxtI, Q.DT, + Depth); case Instruction::Call: if (cast(I)->getIntrinsicID() == Intrinsic::vscale) return true;