Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions llvm/lib/SYCLLowerIR/ESIMD/LowerESIMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
9 changes: 4 additions & 5 deletions llvm/lib/SYCLLowerIR/GlobalOffset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -343,7 +343,7 @@ std::pair<Function *, Value *> 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),
Expand Down Expand Up @@ -390,8 +390,7 @@ std::pair<Function *, Value *> 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;
Expand Down
Loading