diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp index d0a2f7c27e25a..3afefcf55d498 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp @@ -128,7 +128,7 @@ static void createInitOrFiniCalls(Function &F, bool IsCtor) { LoopBB, ExitBB); IRB.SetInsertPoint(LoopBB); auto *CallBackPHI = IRB.CreatePHI(PtrTy, 2, "ptr"); - auto *CallBack = IRB.CreateLoad(CallBackTy->getPointerTo(F.getAddressSpace()), + auto *CallBack = IRB.CreateLoad(IRB.getPtrTy(F.getAddressSpace()), CallBackPHI, "callback"); IRB.CreateCall(CallBackTy, CallBack); auto *NewCallBack = diff --git a/llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.cpp index e941b7e7b7f9f..f77a1f0272c88 100644 --- a/llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.cpp @@ -189,7 +189,7 @@ static void createInitOrFiniCalls(Function &F, bool IsCtor) { LoopBB, ExitBB); IRB.SetInsertPoint(LoopBB); auto *CallBackPHI = IRB.CreatePHI(PtrTy, 2, "ptr"); - auto *CallBack = IRB.CreateLoad(CallBackTy->getPointerTo(F.getAddressSpace()), + auto *CallBack = IRB.CreateLoad(IRB.getPtrTy(F.getAddressSpace()), CallBackPHI, "callback"); IRB.CreateCall(CallBackTy, CallBack); auto *NewCallBack = diff --git a/llvm/unittests/IR/InstructionsTest.cpp b/llvm/unittests/IR/InstructionsTest.cpp index 0ef3f66dbaee4..b03f45e571238 100644 --- a/llvm/unittests/IR/InstructionsTest.cpp +++ b/llvm/unittests/IR/InstructionsTest.cpp @@ -714,7 +714,7 @@ TEST(InstructionsTest, CloneCall) { Type *Int32Ty = Type::getInt32Ty(C); Type *ArgTys[] = {Int32Ty, Int32Ty, Int32Ty}; FunctionType *FnTy = FunctionType::get(Int32Ty, ArgTys, /*isVarArg=*/false); - Value *Callee = Constant::getNullValue(FnTy->getPointerTo()); + Value *Callee = Constant::getNullValue(PointerType::getUnqual(C)); Value *Args[] = { ConstantInt::get(Int32Ty, 1), ConstantInt::get(Int32Ty, 2), @@ -748,7 +748,7 @@ TEST(InstructionsTest, AlterCallBundles) { LLVMContext C; Type *Int32Ty = Type::getInt32Ty(C); FunctionType *FnTy = FunctionType::get(Int32Ty, Int32Ty, /*isVarArg=*/false); - Value *Callee = Constant::getNullValue(FnTy->getPointerTo()); + Value *Callee = Constant::getNullValue(PointerType::getUnqual(C)); Value *Args[] = {ConstantInt::get(Int32Ty, 42)}; OperandBundleDef OldBundle("before", UndefValue::get(Int32Ty)); std::unique_ptr Call( @@ -775,7 +775,7 @@ TEST(InstructionsTest, AlterInvokeBundles) { LLVMContext C; Type *Int32Ty = Type::getInt32Ty(C); FunctionType *FnTy = FunctionType::get(Int32Ty, Int32Ty, /*isVarArg=*/false); - Value *Callee = Constant::getNullValue(FnTy->getPointerTo()); + Value *Callee = Constant::getNullValue(PointerType::getUnqual(C)); Value *Args[] = {ConstantInt::get(Int32Ty, 42)}; std::unique_ptr NormalDest(BasicBlock::Create(C)); std::unique_ptr UnwindDest(BasicBlock::Create(C)); @@ -1501,50 +1501,51 @@ TEST(InstructionsTest, FPCallIsFPMathOperator) { Type *ITy = Type::getInt32Ty(C); FunctionType *IFnTy = FunctionType::get(ITy, {}); - Value *ICallee = Constant::getNullValue(IFnTy->getPointerTo()); + PointerType *PtrTy = PointerType::getUnqual(C); + Value *ICallee = Constant::getNullValue(PtrTy); std::unique_ptr ICall(CallInst::Create(IFnTy, ICallee, {}, "")); EXPECT_FALSE(isa(ICall)); Type *VITy = FixedVectorType::get(ITy, 2); FunctionType *VIFnTy = FunctionType::get(VITy, {}); - Value *VICallee = Constant::getNullValue(VIFnTy->getPointerTo()); + Value *VICallee = Constant::getNullValue(PtrTy); std::unique_ptr VICall(CallInst::Create(VIFnTy, VICallee, {}, "")); EXPECT_FALSE(isa(VICall)); Type *AITy = ArrayType::get(ITy, 2); FunctionType *AIFnTy = FunctionType::get(AITy, {}); - Value *AICallee = Constant::getNullValue(AIFnTy->getPointerTo()); + Value *AICallee = Constant::getNullValue(PtrTy); std::unique_ptr AICall(CallInst::Create(AIFnTy, AICallee, {}, "")); EXPECT_FALSE(isa(AICall)); Type *FTy = Type::getFloatTy(C); FunctionType *FFnTy = FunctionType::get(FTy, {}); - Value *FCallee = Constant::getNullValue(FFnTy->getPointerTo()); + Value *FCallee = Constant::getNullValue(PtrTy); std::unique_ptr FCall(CallInst::Create(FFnTy, FCallee, {}, "")); EXPECT_TRUE(isa(FCall)); Type *VFTy = FixedVectorType::get(FTy, 2); FunctionType *VFFnTy = FunctionType::get(VFTy, {}); - Value *VFCallee = Constant::getNullValue(VFFnTy->getPointerTo()); + Value *VFCallee = Constant::getNullValue(PtrTy); std::unique_ptr VFCall(CallInst::Create(VFFnTy, VFCallee, {}, "")); EXPECT_TRUE(isa(VFCall)); Type *AFTy = ArrayType::get(FTy, 2); FunctionType *AFFnTy = FunctionType::get(AFTy, {}); - Value *AFCallee = Constant::getNullValue(AFFnTy->getPointerTo()); + Value *AFCallee = Constant::getNullValue(PtrTy); std::unique_ptr AFCall(CallInst::Create(AFFnTy, AFCallee, {}, "")); EXPECT_TRUE(isa(AFCall)); Type *AVFTy = ArrayType::get(VFTy, 2); FunctionType *AVFFnTy = FunctionType::get(AVFTy, {}); - Value *AVFCallee = Constant::getNullValue(AVFFnTy->getPointerTo()); + Value *AVFCallee = Constant::getNullValue(PtrTy); std::unique_ptr AVFCall( CallInst::Create(AVFFnTy, AVFCallee, {}, "")); EXPECT_TRUE(isa(AVFCall)); Type *AAVFTy = ArrayType::get(AVFTy, 2); FunctionType *AAVFFnTy = FunctionType::get(AAVFTy, {}); - Value *AAVFCallee = Constant::getNullValue(AAVFFnTy->getPointerTo()); + Value *AAVFCallee = Constant::getNullValue(PtrTy); std::unique_ptr AAVFCall( CallInst::Create(AAVFFnTy, AAVFCallee, {}, "")); EXPECT_TRUE(isa(AAVFCall)); diff --git a/llvm/unittests/IR/VectorBuilderTest.cpp b/llvm/unittests/IR/VectorBuilderTest.cpp index 82ce045ab4b05..4f9e9d7c494d9 100644 --- a/llvm/unittests/IR/VectorBuilderTest.cpp +++ b/llvm/unittests/IR/VectorBuilderTest.cpp @@ -221,9 +221,8 @@ TEST_F(VectorBuilderTest, TestCreateLoadStore) { auto *FloatVecTy = FixedVectorType::get(Type::getFloatTy(Context), VectorNumElements); - auto *FloatVecPtrTy = FloatVecTy->getPointerTo(); - Value *FloatVecPtr = UndefValue::get(FloatVecPtrTy); + Value *FloatVecPtr = UndefValue::get(Builder.getPtrTy(0)); Value *FloatVec = UndefValue::get(FloatVecTy); // vp.load