@@ -2863,9 +2863,9 @@ static bool isKnownNonZeroFromOperator(const Operator *I,
2863
2863
// / Supports values with integer or pointer type and vectors of integers.
2864
2864
bool isKnownNonZero (const Value *V, const APInt &DemandedElts, unsigned Depth,
2865
2865
const SimplifyQuery &Q) {
2866
+ Type *Ty = V->getType ();
2866
2867
2867
2868
#ifndef NDEBUG
2868
- Type *Ty = V->getType ();
2869
2869
assert (Depth <= MaxAnalysisRecursionDepth && " Limit Search Depth" );
2870
2870
2871
2871
if (auto *FVTy = dyn_cast<FixedVectorType>(Ty)) {
@@ -2887,7 +2887,7 @@ bool isKnownNonZero(const Value *V, const APInt &DemandedElts, unsigned Depth,
2887
2887
2888
2888
// For constant vectors, check that all elements are undefined or known
2889
2889
// non-zero to determine that the whole vector is known non-zero.
2890
- if (auto *VecTy = dyn_cast<FixedVectorType>(C-> getType () )) {
2890
+ if (auto *VecTy = dyn_cast<FixedVectorType>(Ty )) {
2891
2891
for (unsigned i = 0 , e = VecTy->getNumElements (); i != e; ++i) {
2892
2892
if (!DemandedElts[i])
2893
2893
continue ;
@@ -2918,7 +2918,7 @@ bool isKnownNonZero(const Value *V, const APInt &DemandedElts, unsigned Depth,
2918
2918
if (MDNode *Ranges = Q.IIQ .getMetadata (I, LLVMContext::MD_range)) {
2919
2919
// If the possible ranges don't contain zero, then the value is
2920
2920
// definitely non-zero.
2921
- assert (V-> getType () ->isIntOrIntVectorTy () && " Range on non-integer?" );
2921
+ assert (Ty ->isIntOrIntVectorTy () && " Range on non-integer?" );
2922
2922
const APInt ZeroValue (Ty->getScalarSizeInBits (), 0 );
2923
2923
if (rangeMetadataExcludesValue (Ranges, ZeroValue))
2924
2924
return true ;
@@ -2934,7 +2934,7 @@ bool isKnownNonZero(const Value *V, const APInt &DemandedElts, unsigned Depth,
2934
2934
2935
2935
// Check for pointer simplifications.
2936
2936
2937
- if (PointerType *PtrTy = dyn_cast<PointerType>(V-> getType () )) {
2937
+ if (PointerType *PtrTy = dyn_cast<PointerType>(Ty )) {
2938
2938
// A byval, inalloca may not be null in a non-default addres space. A
2939
2939
// nonnull argument is assumed never 0.
2940
2940
if (const Argument *A = dyn_cast<Argument>(V)) {
0 commit comments