[Mlir-commits] [mlir] [mlir][arith] Only fold splats for static shape result types (PR #93102)

Jakub Kuderski llvmlistbot at llvm.org
Wed May 22 20:48:00 PDT 2024


================
@@ -2950,6 +2950,14 @@ func.func @unsignedExtendConstantResource() -> tensor<i16> {
   return %ext : tensor<i16>
 }
 
+// Just checks that this doesn't crash.
+// CHECK-LABEL: @signedExtendSplatAsDynamicShape
+func.func @signedExtendSplatAsDynamicShape() -> tensor<?xi64> {
+  %splat = arith.constant dense<5> : tensor<2xi16>
+  %extsplat = arith.extsi %splat : tensor<2xi16> to tensor<?xi64>
----------------
kuhar wrote:

I'm surprised this is even allowed at the level of `artith`. Shouldn't we change the verifier to reject this extend + 'shape cast' pattern instead?

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


More information about the Mlir-commits mailing list