@@ -118,7 +118,7 @@ PreservedAnalyses GlobalOffsetPass::run(Module &M, ModuleAnalysisManager &) {
118
118
KernelImplicitArgumentType =
119
119
ArrayType::get (Type::getInt32Ty (M.getContext ()), 3 );
120
120
ImplicitOffsetPtrType =
121
- Type::getInt32Ty (M.getContext ())-> getPointerTo ( TargetAS);
121
+ PointerType::get ( Type::getInt32Ty (M.getContext ()), TargetAS);
122
122
assert (
123
123
(ImplicitOffsetIntrinsic->getReturnType () == ImplicitOffsetPtrType) &&
124
124
" Implicit offset intrinsic does not return the expected type" );
@@ -179,7 +179,7 @@ void GlobalOffsetPass::processKernelEntryPoint(
179
179
// Add the new argument to all other kernel entry points, despite not
180
180
// using the global offset.
181
181
auto *NewFunc = addOffsetArgumentToFunction (
182
- M, Func, KernelImplicitArgumentType-> getPointerTo ( ),
182
+ M, Func, PointerType::getUnqual (Func-> getContext () ),
183
183
/* KeepOriginal=*/ true ,
184
184
/* IsKernel=*/ true )
185
185
.first ;
@@ -343,7 +343,7 @@ std::pair<Function *, Value *> GlobalOffsetPass::addOffsetArgumentToFunction(
343
343
// addrspace(4), cast implicit offset arg to constant memory so the
344
344
// memcpy is issued into a correct address space.
345
345
auto *OrigImplicitOffsetAS4 = Builder.CreateAddrSpaceCast (
346
- OrigImplicitOffset, Type::getInt8Ty (M.getContext ())-> getPointerTo ( 4 ));
346
+ OrigImplicitOffset, llvm::PointerType::get (M.getContext (), 4 ));
347
347
Builder.CreateMemCpy (
348
348
ImplicitOffsetAlloca, ImplicitOffsetAlloca->getAlign (),
349
349
OrigImplicitOffsetAS4, OrigImplicitOffsetAS4->getPointerAlignment (DL),
@@ -390,8 +390,7 @@ std::pair<Function *, Value *> GlobalOffsetPass::addOffsetArgumentToFunction(
390
390
: EntryBlock->getFirstInsertionPt ();
391
391
IRBuilder<> Builder (EntryBlock, InsertionPt);
392
392
ImplicitOffset = Builder.CreateBitCast (
393
- ImplicitOffset,
394
- Type::getInt32Ty (M.getContext ())->getPointerTo (TargetAS));
393
+ ImplicitOffset, llvm::PointerType::get (M.getContext (), TargetAS));
395
394
}
396
395
397
396
ProcessedFunctions[Func] = ImplicitOffset;
0 commit comments