================
@@ -794,14 +817,20 @@ replaceUsesFromSlot(mlir::OpBuilder &builder,
mlir::Location loc,
/// \p origTy through a coercion slot at the start of \p slotBlock, and point
/// the uses of \p val outside \p createdOps at the result with
/// replaceUsesFromSlot. A direct \p offset lands on the coerced side, so the
-/// view of \p origTy starts at the slot. The coercion's operations are added
-/// to \p createdOps.
+/// view of \p origTy starts at the slot. A pointer that only changes address
+/// space is cast instead. The coercion's operations are added to
+/// \p createdOps.
static mlir::LogicalResult
emitCoercionAndReplaceUses(mlir::OpBuilder &builder, mlir::Location loc,
mlir::Type origTy, mlir::Value src, mlir::Value val,
mlir::Block *slotBlock, const mlir::DataLayout &dl,
SmallPtrSetImpl<mlir::Operation *> &createdOps,
unsigned offset) {
+ if (mlir::Value cast = emitAddrSpaceCoercion(builder, loc, origTy, src,
----------------
skc7 wrote:
When only the address space changes, `addrspacecast` is emitted. AFAIU, any
other mismatch goes through a memory slot, which handles the address space as
well.
https://github.com/llvm/llvm-project/pull/220197
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits