[OpaquePtr] Remove uses of CreateConstGEP1_64() without element type

Remove uses of to-be-deprecated API.
This commit is contained in:
Nikita Popov 2021-07-17 16:38:43 +02:00
parent 251a11fdcf
commit 357756ecf6
3 changed files with 8 additions and 5 deletions

View File

@ -85,7 +85,7 @@ namespace {
(C.toCharUnitsFromBits(OrigBFI.Offset) / lvalue.getAlignment()) *
lvalue.getAlignment();
VoidPtrAddr = CGF.Builder.CreateConstGEP1_64(
VoidPtrAddr, OffsetInChars.getQuantity());
CGF.Int8Ty, VoidPtrAddr, OffsetInChars.getQuantity());
auto Addr = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast(
VoidPtrAddr,
CGF.Builder.getIntNTy(AtomicSizeInBits)->getPointerTo(),

View File

@ -1576,8 +1576,9 @@ ItaniumCXXABI::GetVirtualBaseClassOffset(CodeGenFunction &CGF,
CGM.getItaniumVTableContext().getVirtualBaseOffsetOffset(ClassDecl,
BaseClassDecl);
llvm::Value *VBaseOffsetPtr =
CGF.Builder.CreateConstGEP1_64(VTablePtr, VBaseOffsetOffset.getQuantity(),
"vbase.offset.ptr");
CGF.Builder.CreateConstGEP1_64(
CGF.Int8Ty, VTablePtr, VBaseOffsetOffset.getQuantity(),
"vbase.offset.ptr");
llvm::Value *VBaseOffset;
if (CGM.getItaniumVTableContext().isRelativeLayout()) {

View File

@ -165,8 +165,10 @@ bool AMDGPULateCodeGenPrepare::visitLoadInst(LoadInst &LI) {
PointerType *Int32PtrTy = Type::getInt32PtrTy(LI.getContext(), AS);
PointerType *Int8PtrTy = Type::getInt8PtrTy(LI.getContext(), AS);
auto *NewPtr = IRB.CreateBitCast(
IRB.CreateConstGEP1_64(IRB.CreatePointerBitCastOrAddrSpaceCast(Base, Int8PtrTy),
Offset - Adjust),
IRB.CreateConstGEP1_64(
IRB.getInt8Ty(),
IRB.CreatePointerBitCastOrAddrSpaceCast(Base, Int8PtrTy),
Offset - Adjust),
Int32PtrTy);
LoadInst *NewLd = IRB.CreateAlignedLoad(IRB.getInt32Ty(), NewPtr, Align(4));
NewLd->copyMetadata(LI);