@@ -827,7 +827,7 @@ Constant *SymbolicallyEvaluateBinop(unsigned Opc, Constant *Op0, Constant *Op1,
827
827
// / If array indices are not pointer-sized integers, explicitly cast them so
828
828
// / that they aren't implicitly casted by the getelementptr.
829
829
Constant *CastGEPIndices (Type *SrcElemTy, ArrayRef<Constant *> Ops,
830
- Type *ResultTy, bool InBounds ,
830
+ Type *ResultTy, GEPNoWrapFlags NW ,
831
831
std::optional<ConstantRange> InRange,
832
832
const DataLayout &DL, const TargetLibraryInfo *TLI) {
833
833
Type *IntIdxTy = DL.getIndexType (ResultTy);
@@ -856,8 +856,8 @@ Constant *CastGEPIndices(Type *SrcElemTy, ArrayRef<Constant *> Ops,
856
856
if (!Any)
857
857
return nullptr ;
858
858
859
- Constant *C = ConstantExpr::getGetElementPtr (SrcElemTy, Ops[ 0 ], NewIdxs,
860
- InBounds , InRange);
859
+ Constant *C =
860
+ ConstantExpr::getGetElementPtr (SrcElemTy, Ops[ 0 ], NewIdxs, NW , InRange);
861
861
return ConstantFoldConstant (C, DL, TLI);
862
862
}
863
863
@@ -873,7 +873,7 @@ Constant *SymbolicallyEvaluateGEP(const GEPOperator *GEP,
873
873
if (!SrcElemTy->isSized () || isa<ScalableVectorType>(SrcElemTy))
874
874
return nullptr ;
875
875
876
- if (Constant *C = CastGEPIndices (SrcElemTy, Ops, ResTy, GEP->isInBounds (),
876
+ if (Constant *C = CastGEPIndices (SrcElemTy, Ops, ResTy, GEP->getNoWrapFlags (),
877
877
GEP->getInRange (), DL, TLI))
878
878
return C;
879
879
0 commit comments