[clang] [CIR] Allow cir.copy to work across address spaces- (PR #211873)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 30 06:01:28 PDT 2026


================
@@ -3296,7 +3296,36 @@ void cir::CoroBodyOp::build(OpBuilder &builder, OperationState &result,
 // CopyOp Definitions
 //===----------------------------------------------------------------------===//
 
+// Prints the pointer type(s) for a `cir.copy`. `src` and `dst` share the same
+// pointee type but may differ in address space; a single type is printed when
+// they match, otherwise both are printed (`src` first).
+static void printCopyTypes(mlir::OpAsmPrinter &printer, mlir::Operation *,
+                           mlir::Type srcType, mlir::Type dstType) {
+  printer.printType(srcType);
+  if (srcType != dstType) {
+    printer << ", ";
+    printer.printType(dstType);
+  }
+}
+
+static mlir::ParseResult parseCopyTypes(mlir::OpAsmParser &parser,
----------------
erichkeane wrote:

Tests added!  Works as hoped/anticipated.

https://github.com/llvm/llvm-project/pull/211873


More information about the cfe-commits mailing list