File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -1280,26 +1280,15 @@ struct AAPointerInfoFloating : public AAPointerInfoImpl {
1280
1280
UsrOI = PtrOI;
1281
1281
1282
1282
// TODO: Use range information.
1283
+ APInt GEPOffset (DL.getIndexTypeSizeInBits (GEP->getType ()), 0 );
1283
1284
if (PtrOI.Offset == OffsetAndSize::Unknown ||
1284
- !GEP->hasAllConstantIndices ( )) {
1285
+ !GEP->accumulateConstantOffset (DL, GEPOffset )) {
1285
1286
UsrOI.Offset = OffsetAndSize::Unknown;
1286
1287
Follow = true ;
1287
1288
return true ;
1288
1289
}
1289
1290
1290
- SmallVector<Value *, 8 > Indices;
1291
- for (Use &Idx : GEP->indices ()) {
1292
- if (auto *CIdx = dyn_cast<ConstantInt>(Idx)) {
1293
- Indices.push_back (CIdx);
1294
- continue ;
1295
- }
1296
-
1297
- LLVM_DEBUG (dbgs () << " [AAPointerInfo] Non constant GEP index " << *GEP
1298
- << " : " << *Idx << " \n " );
1299
- return false ;
1300
- }
1301
- UsrOI.Offset = PtrOI.Offset + DL.getIndexedOffsetInType (
1302
- GEP->getSourceElementType (), Indices);
1291
+ UsrOI.Offset = PtrOI.Offset + GEPOffset.getZExtValue ();
1303
1292
Follow = true ;
1304
1293
return true ;
1305
1294
}
You can’t perform that action at this time.
0 commit comments