================
@@ -4731,12 +4731,22 @@ OpenMPIRBuilder::InsertPointOrErrorTy
OpenMPIRBuilder::createReductionsGPU(
&LHSPtr, &RHSPtr, CurFunc));
// Fix the CallBack code genereated to use the correct Values for the LHS
- // and RHS
- LHSPtr->replaceUsesWithIf(RedValue, [ReductionFunc](const Use &U) {
+ // and RHS. Cast to match types before replacing (necessary to handle
SPIRV address
+ // spaces).
+ Value *CastRedValue = RedValue;
+ if (LHSPtr->getType() != RedValue->getType())
+ CastRedValue = Builder.CreatePointerBitCastOrAddrSpaceCast(
----------------
adurang wrote:
As far as I can see, they are always pointers here as they point to the
variables being combined.
https://github.com/llvm/llvm-project/pull/194879
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits