@@ -541,8 +541,8 @@ static Value *rewriteGEPAsOffset(Value *Start, Value *Base,
541
541
// 3. Add the edges for the PHI nodes.
542
542
// 4. Emit GEPs to get the original pointers.
543
543
// 5. Remove the original instructions.
544
- uint64_t IndexSize = DL. getIndexTypeSizeInBits (Start-> getType ());
545
- Type *IndexType = IntegerType::get ( Base->getContext (), IndexSize );
544
+ Type *IndexType = IntegerType::get (
545
+ Base->getContext (), DL. getIndexTypeSizeInBits (Start-> getType ()) );
546
546
547
547
DenseMap<Value *, Value *> NewInsts;
548
548
NewInsts[Base] = ConstantInt::getNullValue (IndexType);
@@ -565,10 +565,6 @@ static Value *rewriteGEPAsOffset(Value *Start, Value *Base,
565
565
continue ;
566
566
567
567
if (auto *GEP = dyn_cast<GEPOperator>(Val)) {
568
- APInt Offset (IndexSize, 0 );
569
- MapVector<Value *, APInt> VarOffsets;
570
- GEP->collectOffset (DL, IndexSize, VarOffsets, Offset);
571
-
572
568
setInsertionPoint (Builder, GEP);
573
569
Value *Op = NewInsts[GEP->getOperand (0 )];
574
570
Value *OffsetV = emitGEPOffset (&Builder, DL, GEP);
0 commit comments