[Mlir-commits] [mlir] [mlir][EmitC] Add rank-0 MemRef conversion (PR #205774)

ioana ghiban llvmlistbot at llvm.org
Wed Jul 1 05:52:36 PDT 2026


================
@@ -142,9 +154,12 @@ createPointerFromEmitcArray(Location loc, OpBuilder &builder,
   return ptr;
 }
 
-// If `v` is defined through an unrealized cast and the source of that cast
-// is `emitc.ptr`, return the pointer.
-static Value stripPointerUnrealizedCast(Value v) {
+static Value getPointerOrStripUnrealizedCast(Value v) {
----------------
ioghiban wrote:

I believa that may not be accurate, since this function may return:
`<<NULL VALUE>>`
`emitc.cast %p : !emitc.ptr<!emitc.opaque<"void">> to !emitc.ptr<i32>`
OR
`unrealized_conversion_cast %arg0 : memref<i32> to !emitc.ptr<i32> {__pure_type_conversion__}`

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


More information about the Mlir-commits mailing list