[Mlir-commits] [mlir] [mlir][emitc] Restrict integer and float types (PR #85788)
Marius Brehler
llvmlistbot at llvm.org
Wed Mar 20 05:42:47 PDT 2024
================
@@ -81,3 +81,19 @@ func.func @illegal_array_with_tensor_element_type(
%arg0: !emitc.array<4xtensor<4xi32>>
) {
}
+
+// -----
+
+func.func @illegal_integer_type(%arg0: i11, %arg1: i11) -> i11 {
+ // expected-error @+1 {{'emitc.mul' op operand #0 must be floating-point type supported by EmitC or integer type supported by EmitC or index or EmitC opaque type, but got 'i11'}}
+ %mul = "emitc.mul" (%arg0, %arg1) : (i11, i11) -> i11
+ return
+}
+
+// -----
+
+func.func @illegal_float_type(%arg0: f80, %arg1: f80) {
+ // expected-error @+1 {{'emitc.mul' op operand #0 must be floating-point type supported by EmitC or integer type supported by EmitC or index or EmitC opaque type, but got 'f80'}}
+ %mul = "emitc.mul" (%arg0, %arg1) : (f80, f80) -> f80
+ return
+}
----------------
marbre wrote:
That is perfectly fine and that's what I had in mind. Just a simple test that checks for the error to be hit.
https://github.com/llvm/llvm-project/pull/85788
More information about the Mlir-commits
mailing list