[Mlir-commits] [mlir] [mlir][linalg] Fix UBSan division-by-zero in PackOp folding (PR #186271)

Mehdi Amini llvmlistbot at llvm.org
Wed Mar 25 05:27:27 PDT 2026


================
@@ -1451,6 +1451,24 @@ func.func @fold_pack_constant_splat(%dest : tensor<4x8x8x32xf32>) -> tensor<4x8x
 
 // -----
 
+// Zero tile size: pack must not be folded into expand_shape.
+// CHECK-LABEL: func.func @pack_zero_tile_not_folded
+// CHECK-NOT:     tensor.expand_shape
+// CHECK:         linalg.pack
+func.func @pack_zero_tile_not_folded(%A: tensor<7x16xi32>) -> tensor<1x16x?x1xi32> {
----------------
joker-eph wrote:

The other one in this file are suffixed with negative, should I update them to be prefixed instead?

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


More information about the Mlir-commits mailing list