Skip to content

Commit 1ba21f6

Browse files
authored
[SYCL] Remove deprecated getPointerTo (#16225)
CMPLRLLVM-63532 Deprecated getPointerTo() got replaced with llvm::PointerType::get(LLVMContext)
1 parent 1e0c021 commit 1ba21f6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

llvm/lib/SYCLLowerIR/ESIMD/LowerESIMD.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,8 +1571,9 @@ static void translateESIMDIntrinsicCall(CallInst &CI) {
15711571
IRBuilder<> Builder(&CI);
15721572

15731573
NewInst = Builder.CreateStore(
1574-
NewCI, Builder.CreateBitCast(CastInstruction->getPointerOperand(),
1575-
NewCI->getType()->getPointerTo()));
1574+
NewCI, Builder.CreateBitCast(
1575+
CastInstruction->getPointerOperand(),
1576+
llvm::PointerType::getUnqual(NewCI->getContext())));
15761577
} else {
15771578
NewInst = addCastInstIfNeeded(&CI, NewCI);
15781579
}

llvm/lib/SYCLLowerIR/GlobalOffset.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ PreservedAnalyses GlobalOffsetPass::run(Module &M, ModuleAnalysisManager &) {
118118
KernelImplicitArgumentType =
119119
ArrayType::get(Type::getInt32Ty(M.getContext()), 3);
120120
ImplicitOffsetPtrType =
121-
Type::getInt32Ty(M.getContext())->getPointerTo(TargetAS);
121+
PointerType::get(Type::getInt32Ty(M.getContext()), TargetAS);
122122
assert(
123123
(ImplicitOffsetIntrinsic->getReturnType() == ImplicitOffsetPtrType) &&
124124
"Implicit offset intrinsic does not return the expected type");
@@ -179,7 +179,7 @@ void GlobalOffsetPass::processKernelEntryPoint(
179179
// Add the new argument to all other kernel entry points, despite not
180180
// using the global offset.
181181
auto *NewFunc = addOffsetArgumentToFunction(
182-
M, Func, KernelImplicitArgumentType->getPointerTo(),
182+
M, Func, PointerType::getUnqual(Func->getContext()),
183183
/*KeepOriginal=*/true,
184184
/*IsKernel=*/true)
185185
.first;
@@ -343,7 +343,7 @@ std::pair<Function *, Value *> GlobalOffsetPass::addOffsetArgumentToFunction(
343343
// addrspace(4), cast implicit offset arg to constant memory so the
344344
// memcpy is issued into a correct address space.
345345
auto *OrigImplicitOffsetAS4 = Builder.CreateAddrSpaceCast(
346-
OrigImplicitOffset, Type::getInt8Ty(M.getContext())->getPointerTo(4));
346+
OrigImplicitOffset, llvm::PointerType::get(M.getContext(), 4));
347347
Builder.CreateMemCpy(
348348
ImplicitOffsetAlloca, ImplicitOffsetAlloca->getAlign(),
349349
OrigImplicitOffsetAS4, OrigImplicitOffsetAS4->getPointerAlignment(DL),
@@ -390,8 +390,7 @@ std::pair<Function *, Value *> GlobalOffsetPass::addOffsetArgumentToFunction(
390390
: EntryBlock->getFirstInsertionPt();
391391
IRBuilder<> Builder(EntryBlock, InsertionPt);
392392
ImplicitOffset = Builder.CreateBitCast(
393-
ImplicitOffset,
394-
Type::getInt32Ty(M.getContext())->getPointerTo(TargetAS));
393+
ImplicitOffset, llvm::PointerType::get(M.getContext(), TargetAS));
395394
}
396395

397396
ProcessedFunctions[Func] = ImplicitOffset;

0 commit comments

Comments
 (0)