@@ -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