Skip to content

Commit 5a09ce9

Browse files
authored
[OpenCL] Replace a CreatePointerCast call; NFC (#112676)
With opaque pointers, the only purpose of the cast here is to cast between address spaces, similar to the 4-argument case below.
1 parent 18b5018 commit 5a09ce9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5636,10 +5636,10 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
56365636
llvm::Type *ArgTys[] = {Arg0->getType(), I8PTy, Int32Ty, Int32Ty};
56375637
llvm::FunctionType *FTy = llvm::FunctionType::get(
56385638
Int32Ty, llvm::ArrayRef<llvm::Type *>(ArgTys), false);
5639-
Value *BCast = Builder.CreatePointerCast(Arg1, I8PTy);
5639+
Value *ACast = Builder.CreateAddrSpaceCast(Arg1, I8PTy);
56405640
return RValue::get(
56415641
EmitRuntimeCall(CGM.CreateRuntimeFunction(FTy, Name),
5642-
{Arg0, BCast, PacketSize, PacketAlign}));
5642+
{Arg0, ACast, PacketSize, PacketAlign}));
56435643
} else {
56445644
assert(4 == E->getNumArgs() &&
56455645
"Illegal number of parameters to pipe function");

0 commit comments

Comments
 (0)