[llvm] b536cba - [ValueTracking] Avoid known bits fallback for non-zero get check (NFCI)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 6 14:17:10 PDT 2020
Author: Nikita Popov
Date: 2020-09-06T23:16:38+02:00
New Revision: b536cbaac5f85a3a1ab8c971c300cd27e5603fda
URL: https://github.com/llvm/llvm-project/commit/b536cbaac5f85a3a1ab8c971c300cd27e5603fda
DIFF: https://github.com/llvm/llvm-project/commit/b536cbaac5f85a3a1ab8c971c300cd27e5603fda.diff
LOG: [ValueTracking] Avoid known bits fallback for non-zero get check (NFCI)
The known bits fall back will never be able to infer a non-null
value here, so don't bother.
Added:
Modified:
llvm/lib/Analysis/ValueTracking.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 3f7cf296ac1c..3a6ee355c646 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -2413,8 +2413,7 @@ bool isKnownNonZero(const Value *V, const APInt &DemandedElts, unsigned Depth,
// truncating casts, e.g., int2ptr/ptr2int with appropriate sizes, as well
// as casts that can alter the value, e.g., AddrSpaceCasts.
if (const GEPOperator *GEP = dyn_cast<GEPOperator>(V))
- if (isGEPKnownNonNull(GEP, Depth, Q))
- return true;
+ return isGEPKnownNonNull(GEP, Depth, Q);
if (auto *BCO = dyn_cast<BitCastOperator>(V))
return isKnownNonZero(BCO->getOperand(0), Depth, Q);
More information about the llvm-commits
mailing list