[Mlir-commits] [mlir] 9729b69 - [mlir] Make kDynamicSize equal to kDynamicOffsetAndStride.

Aliia Khasanova llvmlistbot at llvm.org
Thu Nov 17 01:36:49 PST 2022


Author: Aliia Khasanova
Date: 2022-11-17T09:36:03Z
New Revision: 9729b6930b414f1d882e376a0a18a23d8a8b85cd

URL: https://github.com/llvm/llvm-project/commit/9729b6930b414f1d882e376a0a18a23d8a8b85cd
DIFF: https://github.com/llvm/llvm-project/commit/9729b6930b414f1d882e376a0a18a23d8a8b85cd.diff

LOG: [mlir] Make kDynamicSize equal to kDynamicOffsetAndStride.

Differential Revision: https://reviews.llvm.org/D134807

Added: 
    

Modified: 
    mlir/include/mlir/IR/BuiltinTypeInterfaces.td
    mlir/test/Dialect/Linalg/transform-op-split.mlir
    mlir/test/Dialect/Shape/canonicalize.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/BuiltinTypeInterfaces.td b/mlir/include/mlir/IR/BuiltinTypeInterfaces.td
index 94031fd62bdfa..670b9da6e2443 100644
--- a/mlir/include/mlir/IR/BuiltinTypeInterfaces.td
+++ b/mlir/include/mlir/IR/BuiltinTypeInterfaces.td
@@ -87,7 +87,8 @@ def ShapedTypeInterface : TypeInterface<"ShapedType"> {
     // TODO: merge these two special values in a single one used everywhere.
     // Unfortunately, uses of `-1` have crept deep into the codebase now and are
     // hard to track.
-    static constexpr int64_t kDynamicSize = -1;
+    static constexpr int64_t kDynamicSize =
+        std::numeric_limits<int64_t>::min();
     static constexpr int64_t kDynamicStrideOrOffset =
         std::numeric_limits<int64_t>::min();
 

diff  --git a/mlir/test/Dialect/Linalg/transform-op-split.mlir b/mlir/test/Dialect/Linalg/transform-op-split.mlir
index ae1ee45c96825..ba5ff6ec6bfec 100644
--- a/mlir/test/Dialect/Linalg/transform-op-split.mlir
+++ b/mlir/test/Dialect/Linalg/transform-op-split.mlir
@@ -179,7 +179,7 @@ func.func @two_d(%arg0: tensor<10x34xf32>,
 transform.sequence failures(propagate) {
 ^bb1(%arg1: !pdl.operation):
   // expected-error @below {{expects either a dynamic or a static split point to be provided}}
-  %0:2 = "transform.structured.split"(%arg1) { dimension = 1, static_split_point = -1 } : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
+  %0:2 = "transform.structured.split"(%arg1) { dimension = 1, static_split_point = -9223372036854775808 } : (!pdl.operation) -> (!pdl.operation, !pdl.operation)
 }
 
 // -----

diff  --git a/mlir/test/Dialect/Shape/canonicalize.mlir b/mlir/test/Dialect/Shape/canonicalize.mlir
index 700dc478d330f..12031822a7c8f 100644
--- a/mlir/test/Dialect/Shape/canonicalize.mlir
+++ b/mlir/test/Dialect/Shape/canonicalize.mlir
@@ -815,7 +815,7 @@ func.func @f() {
   // CHECK-NEXT: consume.witness
   // CHECK-NEXT: return
   %cs0 = shape.const_shape [8, 1] : !shape.shape
-  %cs1 = shape.const_shape [1, -1] : !shape.shape
+  %cs1 = shape.const_shape [1, -9223372036854775808] : !shape.shape
   %0 = shape.cstr_broadcastable %cs0, %cs0, %cs1 : !shape.shape, !shape.shape, !shape.shape
   "consume.witness"(%0) : (!shape.witness) -> ()
   return
@@ -830,7 +830,7 @@ func.func @f() {
   // CHECK-NEXT: return
   %cs0 = shape.const_shape [8, 1] : !shape.shape
   %cs1 = shape.const_shape [1, 8] : !shape.shape
-  %cs2 = shape.const_shape [1, -1] : !shape.shape
+  %cs2 = shape.const_shape [1, -9223372036854775808] : !shape.shape
   %0 = shape.cstr_broadcastable %cs0, %cs1, %cs2 : !shape.shape, !shape.shape, !shape.shape
   "consume.witness"(%0) : (!shape.witness) -> ()
   return
@@ -844,8 +844,8 @@ func.func @f() {
   // CHECK-NEXT: consume.witness
   // CHECK-NEXT: return
   %cs0 = shape.const_shape [8, 1] : !shape.shape
-  %cs1 = shape.const_shape [1, -1] : !shape.shape
-  %cs2 = shape.const_shape [8, -1] : !shape.shape
+  %cs1 = shape.const_shape [1, -9223372036854775808] : !shape.shape
+  %cs2 = shape.const_shape [8, -9223372036854775808] : !shape.shape
   %0 = shape.cstr_broadcastable %cs0, %cs1, %cs2 : !shape.shape, !shape.shape, !shape.shape
   "consume.witness"(%0) : (!shape.witness) -> ()
   return


        


More information about the Mlir-commits mailing list