[Mlir-commits] [mlir] [mlir][memref]: Fix Bug in GlobalOp Verifier (PR #144900)

Andrzej WarzyƄski llvmlistbot at llvm.org
Wed Jun 25 07:56:36 PDT 2025


================
@@ -342,6 +342,16 @@ memref.global "priate" constant @memref5 : memref<2xf32>  = uninitialized
 
 // -----
 
+// expected-error @+1 {{op initial value element expected to be of type 'f16', but was of type 'f32'}}
+"memref.global"() <{constant, initial_value = dense<1.000000e+00> : tensor<1xf32>, sym_name = "memref6", sym_visibility = "private", type = memref<1xf16>}> : () -> ()
+
----------------
banach-space wrote:

Wouldn't a "pretty" version like this work as well?
```suggestion
memref.global "private" constant @memref6 : memref<1xf16> =  dense<[1]>
```

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


More information about the Mlir-commits mailing list