From 98d3a7cd2857f8c027bd00ba73e24b7b1013324a Mon Sep 17 00:00:00 2001 From: iree-copybara-bot Date: Wed, 10 Mar 2021 12:34:07 -0800 Subject: [PATCH 1/2] Integrate LLVM at llvm/llvm-project@4c973ae51b85 Updates LLVM usage to match [4c973ae51b85](https://github.com/llvm/llvm-project/commit/4c973ae51b85) PiperOrigin-RevId: 362116801 --- SUBMODULE_VERSIONS.txt | 2 +- .../Transforms/test/dispatch_linalg_on_tensors.mlir | 8 ++++---- .../test/dispatch_linalg_on_tensors_dynamic.mlir | 10 ++++++---- third_party/llvm-project | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/SUBMODULE_VERSIONS.txt b/SUBMODULE_VERSIONS.txt index ec9bad50888b..03957dfdb0fa 100644 --- a/SUBMODULE_VERSIONS.txt +++ b/SUBMODULE_VERSIONS.txt @@ -5,7 +5,7 @@ daff5fead3fbe22c6fc58310ca3f49caf117f185 third_party/benchmark b1fbd33c06cdb0024c67733c6fdec2009d17b384 third_party/googletest 88b845dee001723c4a0db1fe5477de735b6d3bb0 third_party/liburing 5d2cd83f8d192aff5cc4846ab7bb3362c7b82189 third_party/llvm-bazel -df6d0579e18e868ef4b6e97794eacd5af86e1b8a third_party/llvm-project +4c973ae51b859dca9792e1ad87a6673c49815a8d third_party/llvm-project e691ab9fc49d728f6632408d534b82cb3d137b3f third_party/mlir-emitc c217a6ef61d8bc3eeb407d3c09bb343de2dbe769 third_party/mlir-hlo 2b2bd45bbf9be04fd22ece5cc1f54679202e9257 third_party/pffft diff --git a/iree/compiler/Dialect/Flow/Transforms/test/dispatch_linalg_on_tensors.mlir b/iree/compiler/Dialect/Flow/Transforms/test/dispatch_linalg_on_tensors.mlir index 3895e67c9ed1..a4506b7c640d 100644 --- a/iree/compiler/Dialect/Flow/Transforms/test/dispatch_linalg_on_tensors.mlir +++ b/iree/compiler/Dialect/Flow/Transforms/test/dispatch_linalg_on_tensors.mlir @@ -1,8 +1,8 @@ // RUN: iree-opt -split-input-file -verify-diagnostics -iree-flow-dispatch-linalg-on-tensors-pass -iree-flow-dispatch-linalg-on-tensors-tile-sizes="1,2" -iree-flow-dispatch-linalg-on-tensors-enable-fusion-always -canonicalize -cse %s | IreeFileCheck %s -// CHECK-DAG: #[[$MAP:.*]] = affine_map<(d0) -> (2, -d0 + 4)> +// CHECK: #[[mul_map:.+]] = affine_map<()[s0] -> (s0 * 2)> -// CHECK-LABEL: func @tensor +// CHECK: func @tensor func @tensor() -> tensor<2x4xf32> { // CHECK-DAG: %[[C1wg:.*]] = constant 1 : index // CHECK-DAG: %[[C2wg:.*]] = constant 2 : index @@ -33,8 +33,8 @@ func @tensor() -> tensor<2x4xf32> { // CHECK-DAG: %[[biy:.*]] = flow.dispatch.workgroup.id[1] : index // CHECK-DAG: %[[bdy:.*]] = flow.dispatch.workgroup.count[1] : index // CHECK: scf.for %[[I:.*]] = %[[biy]] to %[[C2]] step %[[bdy]] { - // CHECK-NEXT: %[[bix_scaled:.*]] = muli %[[bix]], %[[C2]] : index - // CHECK-NEXT: %[[bdx_scaled:.*]] = muli %[[bdx]], %[[C2]] : index + // CHECK-NEXT: %[[bix_scaled:.*]] = affine.apply #[[mul_map]]()[%[[bix]]] + // CHECK-NEXT: %[[bdx_scaled:.*]] = affine.apply #[[mul_map]]()[%[[bdx]]] // CHECK-NEXT: scf.for %[[J:.*]] = %[[bix_scaled]] to %[[C4]] step %[[bdx_scaled]] { // Canonicalizations not yet powerful enough here. // CHECK-NEXT: %[[MIN_I:.*]] = affine.min{{.*}}(%[[I]]) diff --git a/iree/compiler/Dialect/Flow/Transforms/test/dispatch_linalg_on_tensors_dynamic.mlir b/iree/compiler/Dialect/Flow/Transforms/test/dispatch_linalg_on_tensors_dynamic.mlir index d47e7ea17b77..410529e02107 100644 --- a/iree/compiler/Dialect/Flow/Transforms/test/dispatch_linalg_on_tensors_dynamic.mlir +++ b/iree/compiler/Dialect/Flow/Transforms/test/dispatch_linalg_on_tensors_dynamic.mlir @@ -1,5 +1,7 @@ // RUN: iree-opt -split-input-file -verify-diagnostics -iree-flow-dispatch-linalg-on-tensors-pass -canonicalize -cse %s | IreeFileCheck %s +// CHECK: #[[MULMAP:.+]] = affine_map<()[s0, s1] -> (s0 * s1)> + func @tensor(%arg0 : tensor, %arg1 : tensor, %arg2 : tensor) -> tensor { %1 = linalg.matmul ins(%arg0, %arg1 : tensor, tensor) @@ -23,12 +25,12 @@ func @tensor(%arg0 : tensor, %arg1 : tensor, // CHECK-DAG: %[[WGID_Y:.+]] = flow.dispatch.workgroup.id[1] // CHECK-DAG: %[[WGCOUNT_X:.+]] = flow.dispatch.workgroup.count[0] // CHECK-DAG: %[[WGCOUNT_Y:.+]] = flow.dispatch.workgroup.count[1] -// CHECK: %[[OFFSET_Y:.+]] = muli %[[WGSIZE_Y]], %[[WGID_Y]] -// CHECK: %[[STEP_Y:.+]] = muli %[[WGSIZE_Y]], %[[WGCOUNT_Y]] +// CHECK: %[[OFFSET_Y:.+]] = affine.apply #[[MULMAP]]()[%[[WGID_Y]], %[[WGSIZE_Y]]] +// CHECK: %[[STEP_Y:.+]] = affine.apply #[[MULMAP]]()[%[[WGCOUNT_Y]], %[[WGSIZE_Y]]] // CHECK: scf.for %[[ARG7:.+]] = %[[OFFSET_Y]] // CHECK-SAME: to %{{.+}} step %[[STEP_Y]] -// CHECK: %[[OFFSET_X:.+]] = muli %[[WGSIZE_X]], %[[WGID_X]] -// CHECK: %[[STEP_X:.+]] = muli %[[WGSIZE_X]], %[[WGCOUNT_X]] +// CHECK: %[[OFFSET_X:.+]] = affine.apply #[[MULMAP]]()[%[[WGID_X]], %[[WGSIZE_X]]] +// CHECK: %[[STEP_X:.+]] = affine.apply #[[MULMAP]]()[%[[WGCOUNT_X]], %[[WGSIZE_X]]] // CHECK: scf.for %[[ARG8:.+]] = %[[OFFSET_X]] // CHECK-SAME: to %{{.+}} step %[[STEP_X]] // CHECK: %[[LHS:.+]] = flow.dispatch.input.load %[[ARG3]] diff --git a/third_party/llvm-project b/third_party/llvm-project index df6d0579e18e..4c973ae51b85 160000 --- a/third_party/llvm-project +++ b/third_party/llvm-project @@ -1 +1 @@ -Subproject commit df6d0579e18e868ef4b6e97794eacd5af86e1b8a +Subproject commit 4c973ae51b859dca9792e1ad87a6673c49815a8d From f156c245c1b589f1aa3ab043a5eb4185a697fa1a Mon Sep 17 00:00:00 2001 From: thomasraoux Date: Wed, 10 Mar 2021 16:48:46 -0800 Subject: [PATCH 2/2] Synchronize submodules with LLVM at llvm/llvm-project@4c973ae51b85 --- SUBMODULE_VERSIONS.txt | 6 +++--- third_party/llvm-bazel | 2 +- third_party/mlir-hlo | 2 +- third_party/tensorflow | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SUBMODULE_VERSIONS.txt b/SUBMODULE_VERSIONS.txt index 03957dfdb0fa..7e57652eacf2 100644 --- a/SUBMODULE_VERSIONS.txt +++ b/SUBMODULE_VERSIONS.txt @@ -4,16 +4,16 @@ daff5fead3fbe22c6fc58310ca3f49caf117f185 third_party/benchmark 4fb0ff7069bd88ee85902f4d0bb62794e5f6d021 third_party/flatcc b1fbd33c06cdb0024c67733c6fdec2009d17b384 third_party/googletest 88b845dee001723c4a0db1fe5477de735b6d3bb0 third_party/liburing -5d2cd83f8d192aff5cc4846ab7bb3362c7b82189 third_party/llvm-bazel +37bd064d4f2793bb8b3974233aa39bb227ba2364 third_party/llvm-bazel 4c973ae51b859dca9792e1ad87a6673c49815a8d third_party/llvm-project e691ab9fc49d728f6632408d534b82cb3d137b3f third_party/mlir-emitc -c217a6ef61d8bc3eeb407d3c09bb343de2dbe769 third_party/mlir-hlo +9902e6ee329ba10cb0e2145ce1aa7299d7a60405 third_party/mlir-hlo 2b2bd45bbf9be04fd22ece5cc1f54679202e9257 third_party/pffft d8c7ee00a687ac369e62e2032514a93a9b413502 third_party/pybind11 2887692065c38ef6617f423feafc6b69dd0a0681 third_party/ruy 685f86471e9d26b3eb7676695a2e2cefb4551ae9 third_party/spirv_cross f8bf11a0253a32375c32cad92c841237b96696c0 third_party/spirv_headers -09b2d2ab376a39bfcfe887fa57d03c0ae5bb6d1d third_party/tensorflow +888eae61f875e23a27e368f59915ed95ebafde72 third_party/tensorflow 9c3dac3ed2bd647b8d63f197fed058fee97a7e1e third_party/tracy 9bd3f561bcee3f01d22912de10bb07ce4e23d378 third_party/vulkan_headers 3528e2aed3e8808f33e1e7d63eeb1560456a605a third_party/vulkan_memory_allocator diff --git a/third_party/llvm-bazel b/third_party/llvm-bazel index 5d2cd83f8d19..37bd064d4f27 160000 --- a/third_party/llvm-bazel +++ b/third_party/llvm-bazel @@ -1 +1 @@ -Subproject commit 5d2cd83f8d192aff5cc4846ab7bb3362c7b82189 +Subproject commit 37bd064d4f2793bb8b3974233aa39bb227ba2364 diff --git a/third_party/mlir-hlo b/third_party/mlir-hlo index c217a6ef61d8..9902e6ee329b 160000 --- a/third_party/mlir-hlo +++ b/third_party/mlir-hlo @@ -1 +1 @@ -Subproject commit c217a6ef61d8bc3eeb407d3c09bb343de2dbe769 +Subproject commit 9902e6ee329ba10cb0e2145ce1aa7299d7a60405 diff --git a/third_party/tensorflow b/third_party/tensorflow index 09b2d2ab376a..888eae61f875 160000 --- a/third_party/tensorflow +++ b/third_party/tensorflow @@ -1 +1 @@ -Subproject commit 09b2d2ab376a39bfcfe887fa57d03c0ae5bb6d1d +Subproject commit 888eae61f875e23a27e368f59915ed95ebafde72