diff --git a/clang/lib/CodeGen/CGAtomic.cpp b/clang/lib/CodeGen/CGAtomic.cpp index e5c5e5babf23..b6722ad4e4f1 100644 --- a/clang/lib/CodeGen/CGAtomic.cpp +++ b/clang/lib/CodeGen/CGAtomic.cpp @@ -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(), diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp index 697feafc7369..8d355a8efd50 100644 --- a/clang/lib/CodeGen/ItaniumCXXABI.cpp +++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp @@ -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()) { diff --git a/llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp b/llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp index e57d971b6ef7..4971b010870d 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp @@ -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);