@@ -2879,7 +2879,7 @@ class AllocaSliceRewriter : public InstVisitor<AllocaSliceRewriter, bool> {
2879
2879
" endian_shift" );
2880
2880
}
2881
2881
} else {
2882
- Type *LTy = TargetTy-> getPointerTo (AS);
2882
+ Type *LTy = IRB. getPtrTy (AS);
2883
2883
LoadInst *NewLI =
2884
2884
IRB.CreateAlignedLoad (TargetTy, getNewAllocaSlicePtr (IRB, LTy),
2885
2885
getSliceAlign (), LI.isVolatile (), LI.getName ());
@@ -2909,9 +2909,9 @@ class AllocaSliceRewriter : public InstVisitor<AllocaSliceRewriter, bool> {
2909
2909
// basis for the new value. This allows us to replace the uses of LI with
2910
2910
// the computed value, and then replace the placeholder with LI, leaving
2911
2911
// LI only used for this computation.
2912
- Value *Placeholder = new LoadInst (
2913
- LI.getType (), PoisonValue::get (LI. getType ()-> getPointerTo (AS)), " " ,
2914
- false , Align (1 ));
2912
+ Value *Placeholder =
2913
+ new LoadInst ( LI.getType (), PoisonValue::get (IRB. getPtrTy (AS)), " " ,
2914
+ false , Align (1 ));
2915
2915
V = insertInteger (DL, IRB, Placeholder, V, NewBeginOffset - BeginOffset,
2916
2916
" insert" );
2917
2917
LI.replaceAllUsesWith (V);
@@ -3034,7 +3034,7 @@ class AllocaSliceRewriter : public InstVisitor<AllocaSliceRewriter, bool> {
3034
3034
IRB.CreateAlignedStore (V, NewPtr, NewAI.getAlign (), SI.isVolatile ());
3035
3035
} else {
3036
3036
unsigned AS = SI.getPointerAddressSpace ();
3037
- Value *NewPtr = getNewAllocaSlicePtr (IRB, V-> getType ()-> getPointerTo (AS));
3037
+ Value *NewPtr = getNewAllocaSlicePtr (IRB, IRB. getPtrTy (AS));
3038
3038
NewSI =
3039
3039
IRB.CreateAlignedStore (V, NewPtr, getSliceAlign (), SI.isVolatile ());
3040
3040
}
@@ -3389,7 +3389,6 @@ class AllocaSliceRewriter : public InstVisitor<AllocaSliceRewriter, bool> {
3389
3389
} else {
3390
3390
OtherTy = NewAllocaTy;
3391
3391
}
3392
- OtherPtrTy = OtherTy->getPointerTo (OtherAS);
3393
3392
3394
3393
Value *AdjPtr = getAdjustedPtr (IRB, DL, OtherPtr, OtherOffset, OtherPtrTy,
3395
3394
OtherPtr->getName () + " ." );
0 commit comments