Skip to content

Commit 4ce7c4a

Browse files
committed
[llvm] Drop some typed pointer handling/bitcasts
Differential Revision: https://reviews.llvm.org/D157016
1 parent 2bdc864 commit 4ce7c4a

19 files changed

+112
-168
lines changed

llvm/include/llvm/Transforms/Utils/BuildLibCalls.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ namespace llvm {
8080
LibFunc DoubleFn, LibFunc FloatFn, LibFunc LongDoubleFn,
8181
LibFunc &TheLibFunc);
8282

83-
/// Return V if it is an i8*, otherwise cast it to i8*.
84-
Value *castToCStr(Value *V, IRBuilderBase &B);
85-
8683
/// Emit a call to the strlen function to the builder, for the specified
8784
/// pointer. Ptr is required to be some pointer type, and the return value has
8885
/// 'size_t' type.

llvm/lib/CodeGen/AtomicExpandPass.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,8 @@ LoadInst *AtomicExpand::convertAtomicLoadToIntegerType(LoadInst *LI) {
373373
ReplacementIRBuilder Builder(LI, *DL);
374374

375375
Value *Addr = LI->getPointerOperand();
376-
Type *PT = PointerType::get(NewTy, Addr->getType()->getPointerAddressSpace());
377-
Value *NewAddr = Builder.CreateBitCast(Addr, PT);
378376

379-
auto *NewLI = Builder.CreateLoad(NewTy, NewAddr);
377+
auto *NewLI = Builder.CreateLoad(NewTy, Addr);
380378
NewLI->setAlignment(LI->getAlign());
381379
NewLI->setVolatile(LI->isVolatile());
382380
NewLI->setAtomic(LI->getOrdering(), LI->getSyncScopeID());
@@ -398,14 +396,12 @@ AtomicExpand::convertAtomicXchgToIntegerType(AtomicRMWInst *RMWI) {
398396

399397
Value *Addr = RMWI->getPointerOperand();
400398
Value *Val = RMWI->getValOperand();
401-
Type *PT = PointerType::get(NewTy, RMWI->getPointerAddressSpace());
402-
Value *NewAddr = Builder.CreateBitCast(Addr, PT);
403399
Value *NewVal = Val->getType()->isPointerTy()
404400
? Builder.CreatePtrToInt(Val, NewTy)
405401
: Builder.CreateBitCast(Val, NewTy);
406402

407403
auto *NewRMWI =
408-
Builder.CreateAtomicRMW(AtomicRMWInst::Xchg, NewAddr, NewVal,
404+
Builder.CreateAtomicRMW(AtomicRMWInst::Xchg, Addr, NewVal,
409405
RMWI->getAlign(), RMWI->getOrdering());
410406
NewRMWI->setVolatile(RMWI->isVolatile());
411407
LLVM_DEBUG(dbgs() << "Replaced " << *RMWI << " with " << *NewRMWI << "\n");
@@ -508,10 +504,8 @@ StoreInst *AtomicExpand::convertAtomicStoreToIntegerType(StoreInst *SI) {
508504
Value *NewVal = Builder.CreateBitCast(SI->getValueOperand(), NewTy);
509505

510506
Value *Addr = SI->getPointerOperand();
511-
Type *PT = PointerType::get(NewTy, Addr->getType()->getPointerAddressSpace());
512-
Value *NewAddr = Builder.CreateBitCast(Addr, PT);
513507

514-
StoreInst *NewSI = Builder.CreateStore(NewVal, NewAddr);
508+
StoreInst *NewSI = Builder.CreateStore(NewVal, Addr);
515509
NewSI->setAlignment(SI->getAlign());
516510
NewSI->setVolatile(SI->isVolatile());
517511
NewSI->setAtomic(SI->getOrdering(), SI->getSyncScopeID());
@@ -1188,14 +1182,12 @@ AtomicExpand::convertCmpXchgToIntegerType(AtomicCmpXchgInst *CI) {
11881182
ReplacementIRBuilder Builder(CI, *DL);
11891183

11901184
Value *Addr = CI->getPointerOperand();
1191-
Type *PT = PointerType::get(NewTy, Addr->getType()->getPointerAddressSpace());
1192-
Value *NewAddr = Builder.CreateBitCast(Addr, PT);
11931185

11941186
Value *NewCmp = Builder.CreatePtrToInt(CI->getCompareOperand(), NewTy);
11951187
Value *NewNewVal = Builder.CreatePtrToInt(CI->getNewValOperand(), NewTy);
11961188

11971189
auto *NewCI = Builder.CreateAtomicCmpXchg(
1198-
NewAddr, NewCmp, NewNewVal, CI->getAlign(), CI->getSuccessOrdering(),
1190+
Addr, NewCmp, NewNewVal, CI->getAlign(), CI->getSuccessOrdering(),
11991191
CI->getFailureOrdering(), CI->getSyncScopeID());
12001192
NewCI->setVolatile(CI->isVolatile());
12011193
NewCI->setWeak(CI->isWeak());

llvm/lib/CodeGen/CodeGenPrepare.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5493,7 +5493,7 @@ bool CodeGenPrepare::optimizeMemoryInst(Instruction *MemoryInst, Value *Addr,
54935493
return Modified;
54945494
} else {
54955495
Type *I8PtrTy =
5496-
Builder.getInt8PtrTy(Addr->getType()->getPointerAddressSpace());
5496+
Builder.getPtrTy(Addr->getType()->getPointerAddressSpace());
54975497
Type *I8Ty = Builder.getInt8Ty();
54985498

54995499
// Start with the base register. Do this first so that subsequent address
@@ -6130,7 +6130,7 @@ bool CodeGenPrepare::splitLargeGEPOffsets() {
61306130
LLVMContext &Ctx = GEP->getContext();
61316131
Type *PtrIdxTy = DL->getIndexType(GEP->getType());
61326132
Type *I8PtrTy =
6133-
Type::getInt8PtrTy(Ctx, GEP->getType()->getPointerAddressSpace());
6133+
PointerType::get(Ctx, GEP->getType()->getPointerAddressSpace());
61346134
Type *I8Ty = Type::getInt8Ty(Ctx);
61356135

61366136
if (!NewBaseGEP) {

llvm/lib/CodeGen/LowerEmuTLS.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ bool LowerEmuTLS::runOnModule(Module &M) {
8585

8686
bool LowerEmuTLS::addEmuTlsVar(Module &M, const GlobalVariable *GV) {
8787
LLVMContext &C = M.getContext();
88-
PointerType *VoidPtrType = Type::getInt8PtrTy(C);
88+
PointerType *VoidPtrType = PointerType::getUnqual(C);
8989

9090
std::string EmuTlsVarName = ("__emutls_v." + GV->getName()).str();
9191
GlobalVariable *EmuTlsVar = M.getNamedGlobal(EmuTlsVarName);
@@ -114,8 +114,7 @@ bool LowerEmuTLS::addEmuTlsVar(Module &M, const GlobalVariable *GV) {
114114
// void *templ; // 0 or point to __emutls_t.*
115115
// sizeof(word) should be the same as sizeof(void*) on target.
116116
IntegerType *WordType = DL.getIntPtrType(C);
117-
PointerType *InitPtrType = InitValue ?
118-
PointerType::getUnqual(InitValue->getType()) : VoidPtrType;
117+
PointerType *InitPtrType = PointerType::getUnqual(C);
119118
Type *ElementTypes[4] = {WordType, WordType, VoidPtrType, InitPtrType};
120119
ArrayRef<Type*> ElementTypeArray(ElementTypes, 4);
121120
StructType *EmuTlsVarType = StructType::create(ElementTypeArray);

llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ static bool lowerLoadRelative(Function &F) {
7070

7171
bool Changed = false;
7272
Type *Int32Ty = Type::getInt32Ty(F.getContext());
73-
Type *Int32PtrTy = Int32Ty->getPointerTo();
7473
Type *Int8Ty = Type::getInt8Ty(F.getContext());
7574

7675
for (Use &U : llvm::make_early_inc_range(F.uses())) {
@@ -81,8 +80,7 @@ static bool lowerLoadRelative(Function &F) {
8180
IRBuilder<> B(CI);
8281
Value *OffsetPtr =
8382
B.CreateGEP(Int8Ty, CI->getArgOperand(0), CI->getArgOperand(1));
84-
Value *OffsetPtrI32 = B.CreateBitCast(OffsetPtr, Int32PtrTy);
85-
Value *OffsetI32 = B.CreateAlignedLoad(Int32Ty, OffsetPtrI32, Align(4));
83+
Value *OffsetI32 = B.CreateAlignedLoad(Int32Ty, OffsetPtr, Align(4));
8684

8785
Value *ResultPtr = B.CreateGEP(Int8Ty, CI->getArgOperand(0), OffsetI32);
8886

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,9 +1296,8 @@ SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N, ArrayRef<SDValue> Ops,
12961296
}
12971297

12981298
Align SelectionDAG::getEVTAlign(EVT VT) const {
1299-
Type *Ty = VT == MVT::iPTR ?
1300-
PointerType::get(Type::getInt8Ty(*getContext()), 0) :
1301-
VT.getTypeForEVT(*getContext());
1299+
Type *Ty = VT == MVT::iPTR ? PointerType::get(*getContext(), 0)
1300+
: VT.getTypeForEVT(*getContext());
13021301

13031302
return getDataLayout().getABITypeAlign(Ty);
13041303
}
@@ -7727,7 +7726,7 @@ SDValue SelectionDAG::getMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst,
77277726
// Emit a library call.
77287727
TargetLowering::ArgListTy Args;
77297728
TargetLowering::ArgListEntry Entry;
7730-
Entry.Ty = Type::getInt8PtrTy(*getContext());
7729+
Entry.Ty = PointerType::getUnqual(*getContext());
77317730
Entry.Node = Dst; Args.push_back(Entry);
77327731
Entry.Node = Src; Args.push_back(Entry);
77337732

@@ -7829,7 +7828,7 @@ SDValue SelectionDAG::getMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst,
78297828
// Emit a library call.
78307829
TargetLowering::ArgListTy Args;
78317830
TargetLowering::ArgListEntry Entry;
7832-
Entry.Ty = Type::getInt8PtrTy(*getContext());
7831+
Entry.Ty = PointerType::getUnqual(*getContext());
78337832
Entry.Node = Dst; Args.push_back(Entry);
78347833
Entry.Node = Src; Args.push_back(Entry);
78357834

@@ -7958,14 +7957,14 @@ SDValue SelectionDAG::getMemset(SDValue Chain, const SDLoc &dl, SDValue Dst,
79587957
// If zeroing out and bzero is present, use it.
79597958
if (SrcIsZero && BzeroName) {
79607959
TargetLowering::ArgListTy Args;
7961-
Args.push_back(CreateEntry(Dst, Type::getInt8PtrTy(Ctx)));
7960+
Args.push_back(CreateEntry(Dst, PointerType::getUnqual(Ctx)));
79627961
Args.push_back(CreateEntry(Size, DL.getIntPtrType(Ctx)));
79637962
CLI.setLibCallee(
79647963
TLI->getLibcallCallingConv(RTLIB::BZERO), Type::getVoidTy(Ctx),
79657964
getExternalSymbol(BzeroName, TLI->getPointerTy(DL)), std::move(Args));
79667965
} else {
79677966
TargetLowering::ArgListTy Args;
7968-
Args.push_back(CreateEntry(Dst, Type::getInt8PtrTy(Ctx)));
7967+
Args.push_back(CreateEntry(Dst, PointerType::getUnqual(Ctx)));
79697968
Args.push_back(CreateEntry(Src, Src.getValueType().getTypeForEVT(Ctx)));
79707969
Args.push_back(CreateEntry(Size, DL.getIntPtrType(Ctx)));
79717970
CLI.setLibCallee(TLI->getLibcallCallingConv(RTLIB::MEMSET),

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2775,7 +2775,7 @@ void SelectionDAGBuilder::visitSPDescriptorParent(StackProtectorDescriptor &SPD,
27752775
SDValue StackSlotPtr = DAG.getFrameIndex(FI, PtrTy);
27762776
const Module &M = *ParentBB->getParent()->getFunction().getParent();
27772777
Align Align =
2778-
DAG.getDataLayout().getPrefTypeAlign(Type::getInt8PtrTy(M.getContext()));
2778+
DAG.getDataLayout().getPrefTypeAlign(PointerType::get(M.getContext(), 0));
27792779

27802780
// Generate code to load the content of the guard slot.
27812781
SDValue GuardVal = DAG.getLoad(

llvm/lib/Target/Hexagon/HexagonISelLowering.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3847,11 +3847,6 @@ Value *HexagonTargetLowering::emitLoadLinked(IRBuilderBase &Builder,
38473847
: Intrinsic::hexagon_L4_loadd_locked;
38483848
Function *Fn = Intrinsic::getDeclaration(M, IntID);
38493849

3850-
auto PtrTy = cast<PointerType>(Addr->getType());
3851-
PointerType *NewPtrTy =
3852-
Builder.getIntNTy(SZ)->getPointerTo(PtrTy->getAddressSpace());
3853-
Addr = Builder.CreateBitCast(Addr, NewPtrTy);
3854-
38553850
Value *Call = Builder.CreateCall(Fn, Addr, "larx");
38563851

38573852
return Builder.CreateBitCast(Call, ValueTy);
@@ -3873,8 +3868,6 @@ Value *HexagonTargetLowering::emitStoreConditional(IRBuilderBase &Builder,
38733868
: Intrinsic::hexagon_S4_stored_locked;
38743869
Function *Fn = Intrinsic::getDeclaration(M, IntID);
38753870

3876-
unsigned AS = Addr->getType()->getPointerAddressSpace();
3877-
Addr = Builder.CreateBitCast(Addr, CastTy->getPointerTo(AS));
38783871
Val = Builder.CreateBitCast(Val, CastTy);
38793872

38803873
Value *Call = Builder.CreateCall(Fn, {Addr, Val}, "stcx");

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17342,10 +17342,8 @@ static Value *useTpOffset(IRBuilderBase &IRB, unsigned Offset) {
1734217342
Module *M = IRB.GetInsertBlock()->getParent()->getParent();
1734317343
Function *ThreadPointerFunc =
1734417344
Intrinsic::getDeclaration(M, Intrinsic::thread_pointer);
17345-
return IRB.CreatePointerCast(
17346-
IRB.CreateConstGEP1_32(IRB.getInt8Ty(),
17347-
IRB.CreateCall(ThreadPointerFunc), Offset),
17348-
IRB.getInt8PtrTy()->getPointerTo(0));
17345+
return IRB.CreateConstGEP1_32(IRB.getInt8Ty(),
17346+
IRB.CreateCall(ThreadPointerFunc), Offset);
1734917347
}
1735017348

1735117349
Value *RISCVTargetLowering::getIRStackGuard(IRBuilderBase &IRB) const {

llvm/lib/Target/X86/X86ISelLoweringCall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ static Constant* SegmentOffset(IRBuilderBase &IRB,
561561
int Offset, unsigned AddressSpace) {
562562
return ConstantExpr::getIntToPtr(
563563
ConstantInt::get(Type::getInt32Ty(IRB.getContext()), Offset),
564-
Type::getInt8PtrTy(IRB.getContext())->getPointerTo(AddressSpace));
564+
IRB.getPtrTy(AddressSpace));
565565
}
566566

567567
Value *X86TargetLowering::getIRStackGuard(IRBuilderBase &IRB) const {

llvm/lib/Transforms/Coroutines/CoroSplit.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,6 @@ Value *CoroCloner::deriveNewFramePointer() {
811811
auto *ActiveAsyncSuspend = cast<CoroSuspendAsyncInst>(ActiveSuspend);
812812
auto ContextIdx = ActiveAsyncSuspend->getStorageArgumentIndex() & 0xff;
813813
auto *CalleeContext = NewF->getArg(ContextIdx);
814-
auto *FramePtrTy = Shape.FrameTy->getPointerTo();
815814
auto *ProjectionFunc =
816815
ActiveAsyncSuspend->getAsyncContextProjectionFunction();
817816
auto DbgLoc =
@@ -831,7 +830,7 @@ Value *CoroCloner::deriveNewFramePointer() {
831830
auto InlineRes = InlineFunction(*CallerContext, InlineInfo);
832831
assert(InlineRes.isSuccess());
833832
(void)InlineRes;
834-
return Builder.CreateBitCast(FramePtrAddr, FramePtrTy);
833+
return FramePtrAddr;
835834
}
836835
// In continuation-lowering, the argument is the opaque storage.
837836
case coro::ABI::Retcon:
@@ -841,12 +840,10 @@ Value *CoroCloner::deriveNewFramePointer() {
841840

842841
// If the storage is inline, just bitcast to the storage to the frame type.
843842
if (Shape.RetconLowering.IsFrameInlineInStorage)
844-
return Builder.CreateBitCast(NewStorage, FramePtrTy);
843+
return NewStorage;
845844

846845
// Otherwise, load the real frame from the opaque storage.
847-
auto FramePtrPtr =
848-
Builder.CreateBitCast(NewStorage, FramePtrTy->getPointerTo());
849-
return Builder.CreateLoad(FramePtrTy, FramePtrPtr);
846+
return Builder.CreateLoad(FramePtrTy, NewStorage);
850847
}
851848
}
852849
llvm_unreachable("bad ABI");
@@ -1829,9 +1826,7 @@ static void splitRetconCoroutine(Function &F, coro::Shape &Shape,
18291826
Builder.CreateBitCast(RawFramePtr, Shape.CoroBegin->getType());
18301827

18311828
// Stash the allocated frame pointer in the continuation storage.
1832-
auto Dest = Builder.CreateBitCast(Id->getStorage(),
1833-
RawFramePtr->getType()->getPointerTo());
1834-
Builder.CreateStore(RawFramePtr, Dest);
1829+
Builder.CreateStore(RawFramePtr, Id->getStorage());
18351830
}
18361831

18371832
// Map all uses of llvm.coro.begin to the allocated frame pointer.

llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,7 @@ void DevirtModule::applyICallBranchFunnel(VTableSlotInfo &SlotInfo,
14371437

14381438
IRBuilder<> IRB(&CB);
14391439
std::vector<Value *> Args;
1440-
Args.push_back(IRB.CreateBitCast(VCallSite.VTable, Int8PtrTy));
1440+
Args.push_back(VCallSite.VTable);
14411441
llvm::append_range(Args, CB.args());
14421442

14431443
CallBase *NewCS = nullptr;
@@ -1708,8 +1708,7 @@ void DevirtModule::applyVirtualConstProp(CallSiteInfo &CSInfo, StringRef FnName,
17081708
continue;
17091709
auto *RetType = cast<IntegerType>(Call.CB.getType());
17101710
IRBuilder<> B(&Call.CB);
1711-
Value *Addr =
1712-
B.CreateGEP(Int8Ty, B.CreateBitCast(Call.VTable, Int8PtrTy), Byte);
1711+
Value *Addr = B.CreateGEP(Int8Ty, Call.VTable, Byte);
17131712
if (RetType->getBitWidth() == 1) {
17141713
Value *Bits = B.CreateLoad(Int8Ty, Addr);
17151714
Value *BitsAndBit = B.CreateAnd(Bits, Bit);
@@ -2007,17 +2006,14 @@ void DevirtModule::scanTypeCheckedLoadUsers(Function *TypeCheckedLoadFunc) {
20072006
if (TypeCheckedLoadFunc->getIntrinsicID() ==
20082007
Intrinsic::type_checked_load_relative) {
20092008
Value *GEP = LoadB.CreateGEP(Int8Ty, Ptr, Offset);
2010-
Value *GEPPtr = LoadB.CreateBitCast(GEP, PointerType::getUnqual(Int32Ty));
2011-
LoadedValue = LoadB.CreateLoad(Int32Ty, GEPPtr);
2009+
LoadedValue = LoadB.CreateLoad(Int32Ty, GEP);
20122010
LoadedValue = LoadB.CreateSExt(LoadedValue, IntPtrTy);
20132011
GEP = LoadB.CreatePtrToInt(GEP, IntPtrTy);
20142012
LoadedValue = LoadB.CreateAdd(GEP, LoadedValue);
20152013
LoadedValue = LoadB.CreateIntToPtr(LoadedValue, Int8PtrTy);
20162014
} else {
20172015
Value *GEP = LoadB.CreateGEP(Int8Ty, Ptr, Offset);
2018-
Value *GEPPtr =
2019-
LoadB.CreateBitCast(GEP, PointerType::getUnqual(Int8PtrTy));
2020-
LoadedValue = LoadB.CreateLoad(Int8PtrTy, GEPPtr);
2016+
LoadedValue = LoadB.CreateLoad(Int8PtrTy, GEP);
20212017
}
20222018

20232019
for (Instruction *LoadedPtr : LoadedPtrs) {

llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,8 +1051,8 @@ FunctionCallee GCOVProfiler::getEmitFunctionFunc(const TargetLibraryInfo *TLI) {
10511051

10521052
FunctionCallee GCOVProfiler::getEmitArcsFunc(const TargetLibraryInfo *TLI) {
10531053
Type *Args[] = {
1054-
Type::getInt32Ty(*Ctx), // uint32_t num_counters
1055-
Type::getInt64PtrTy(*Ctx), // uint64_t *counters
1054+
Type::getInt32Ty(*Ctx), // uint32_t num_counters
1055+
PointerType::getUnqual(*Ctx), // uint64_t *counters
10561056
};
10571057
FunctionType *FTy = FunctionType::get(Type::getVoidTy(*Ctx), Args, false);
10581058
return M->getOrInsertFunction("llvm_gcda_emit_arcs", FTy,

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4902,7 +4902,7 @@ struct VarArgAMD64Helper : public VarArgHelper {
49024902
NextNodeIRBuilder IRB(OrigInst);
49034903
Value *VAListTag = OrigInst->getArgOperand(0);
49044904

4905-
Type *RegSaveAreaPtrTy = Type::getInt64PtrTy(*MS.C);
4905+
Type *RegSaveAreaPtrTy = PointerType::getUnqual(*MS.C); // i64*
49064906
Value *RegSaveAreaPtrPtr = IRB.CreateIntToPtr(
49074907
IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
49084908
ConstantInt::get(MS.IntptrTy, 16)),
@@ -4919,7 +4919,7 @@ struct VarArgAMD64Helper : public VarArgHelper {
49194919
if (MS.TrackOrigins)
49204920
IRB.CreateMemCpy(RegSaveAreaOriginPtr, Alignment, VAArgTLSOriginCopy,
49214921
Alignment, AMD64FpEndOffset);
4922-
Type *OverflowArgAreaPtrTy = Type::getInt64PtrTy(*MS.C);
4922+
Type *OverflowArgAreaPtrTy = PointerType::getUnqual(*MS.C); // i64*
49234923
Value *OverflowArgAreaPtrPtr = IRB.CreateIntToPtr(
49244924
IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
49254925
ConstantInt::get(MS.IntptrTy, 8)),
@@ -5051,7 +5051,7 @@ struct VarArgMIPS64Helper : public VarArgHelper {
50515051
CallInst *OrigInst = VAStartInstrumentationList[i];
50525052
NextNodeIRBuilder IRB(OrigInst);
50535053
Value *VAListTag = OrigInst->getArgOperand(0);
5054-
Type *RegSaveAreaPtrTy = Type::getInt64PtrTy(*MS.C);
5054+
Type *RegSaveAreaPtrTy = PointerType::getUnqual(*MS.C); // i64*
50555055
Value *RegSaveAreaPtrPtr =
50565056
IRB.CreateIntToPtr(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
50575057
PointerType::get(RegSaveAreaPtrTy, 0));
@@ -5498,7 +5498,7 @@ struct VarArgPowerPC64Helper : public VarArgHelper {
54985498
CallInst *OrigInst = VAStartInstrumentationList[i];
54995499
NextNodeIRBuilder IRB(OrigInst);
55005500
Value *VAListTag = OrigInst->getArgOperand(0);
5501-
Type *RegSaveAreaPtrTy = Type::getInt64PtrTy(*MS.C);
5501+
Type *RegSaveAreaPtrTy = PointerType::getUnqual(*MS.C); // i64*
55025502
Value *RegSaveAreaPtrPtr =
55035503
IRB.CreateIntToPtr(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
55045504
PointerType::get(RegSaveAreaPtrTy, 0));
@@ -5743,7 +5743,7 @@ struct VarArgSystemZHelper : public VarArgHelper {
57435743
void visitVACopyInst(VACopyInst &I) override { unpoisonVAListTagForInst(I); }
57445744

57455745
void copyRegSaveArea(IRBuilder<> &IRB, Value *VAListTag) {
5746-
Type *RegSaveAreaPtrTy = Type::getInt64PtrTy(*MS.C);
5746+
Type *RegSaveAreaPtrTy = PointerType::getUnqual(*MS.C); // i64*
57475747
Value *RegSaveAreaPtrPtr = IRB.CreateIntToPtr(
57485748
IRB.CreateAdd(
57495749
IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
@@ -5768,7 +5768,7 @@ struct VarArgSystemZHelper : public VarArgHelper {
57685768
}
57695769

57705770
void copyOverflowArea(IRBuilder<> &IRB, Value *VAListTag) {
5771-
Type *OverflowArgAreaPtrTy = Type::getInt64PtrTy(*MS.C);
5771+
Type *OverflowArgAreaPtrTy = PointerType::getUnqual(*MS.C); // i64*
57725772
Value *OverflowArgAreaPtrPtr = IRB.CreateIntToPtr(
57735773
IRB.CreateAdd(
57745774
IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),

0 commit comments

Comments
 (0)