diff --git a/llvm/lib/SYCLLowerIR/ESIMD/LowerESIMD.cpp b/llvm/lib/SYCLLowerIR/ESIMD/LowerESIMD.cpp index b0354ff6fdb64..02b08543ba2e6 100644 --- a/llvm/lib/SYCLLowerIR/ESIMD/LowerESIMD.cpp +++ b/llvm/lib/SYCLLowerIR/ESIMD/LowerESIMD.cpp @@ -1575,8 +1575,9 @@ static void translateESIMDIntrinsicCall(CallInst &CI) { IRBuilder<> Builder(&CI); NewInst = Builder.CreateStore( - NewCI, Builder.CreateBitCast(CastInstruction->getPointerOperand(), - NewCI->getType()->getPointerTo())); + NewCI, Builder.CreateBitCast( + CastInstruction->getPointerOperand(), + llvm::PointerType::getUnqual(NewCI->getContext()))); } else { NewInst = addCastInstIfNeeded(&CI, NewCI); } diff --git a/llvm/lib/SYCLLowerIR/GlobalOffset.cpp b/llvm/lib/SYCLLowerIR/GlobalOffset.cpp index 3873b2f8837e5..36d949c0f19a7 100644 --- a/llvm/lib/SYCLLowerIR/GlobalOffset.cpp +++ b/llvm/lib/SYCLLowerIR/GlobalOffset.cpp @@ -118,7 +118,7 @@ PreservedAnalyses GlobalOffsetPass::run(Module &M, ModuleAnalysisManager &) { KernelImplicitArgumentType = ArrayType::get(Type::getInt32Ty(M.getContext()), 3); ImplicitOffsetPtrType = - Type::getInt32Ty(M.getContext())->getPointerTo(TargetAS); + PointerType::get(Type::getInt32Ty(M.getContext()), TargetAS); assert( (ImplicitOffsetIntrinsic->getReturnType() == ImplicitOffsetPtrType) && "Implicit offset intrinsic does not return the expected type"); @@ -179,7 +179,7 @@ void GlobalOffsetPass::processKernelEntryPoint( // Add the new argument to all other kernel entry points, despite not // using the global offset. auto *NewFunc = addOffsetArgumentToFunction( - M, Func, KernelImplicitArgumentType->getPointerTo(), + M, Func, PointerType::getUnqual(Func->getContext()), /*KeepOriginal=*/true, /*IsKernel=*/true) .first; @@ -343,7 +343,7 @@ std::pair GlobalOffsetPass::addOffsetArgumentToFunction( // addrspace(4), cast implicit offset arg to constant memory so the // memcpy is issued into a correct address space. auto *OrigImplicitOffsetAS4 = Builder.CreateAddrSpaceCast( - OrigImplicitOffset, Type::getInt8Ty(M.getContext())->getPointerTo(4)); + OrigImplicitOffset, llvm::PointerType::get(M.getContext(), 4)); Builder.CreateMemCpy( ImplicitOffsetAlloca, ImplicitOffsetAlloca->getAlign(), OrigImplicitOffsetAS4, OrigImplicitOffsetAS4->getPointerAlignment(DL), @@ -390,8 +390,7 @@ std::pair GlobalOffsetPass::addOffsetArgumentToFunction( : EntryBlock->getFirstInsertionPt(); IRBuilder<> Builder(EntryBlock, InsertionPt); ImplicitOffset = Builder.CreateBitCast( - ImplicitOffset, - Type::getInt32Ty(M.getContext())->getPointerTo(TargetAS)); + ImplicitOffset, llvm::PointerType::get(M.getContext(), TargetAS)); } ProcessedFunctions[Func] = ImplicitOffset;