From 4cec8265f7ae20c99feb0e21049e0e48fae6a7de Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Fri, 13 Sep 2024 19:06:19 +0000 Subject: [PATCH] Integrate LLVM at llvm/llvm-project@f0b3287297ae --- WORKSPACE.bazel | 4 ++-- build_tools/llvm_version.txt | 2 +- stablehlo/conversions/tosa/tests/unary.mlir | 4 ++-- .../conversions/tosa/transforms/StablehloLegalizeToTosa.cpp | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 00f939456c2..484866f7b06 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -17,9 +17,9 @@ workspace(name = "stablehlo") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -LLVM_COMMIT = "eaa95a1c2bd38332c1a4e634595f29d22b28ffea" +LLVM_COMMIT = "f0b3287297aeeddcf030e3c1b08d05a69ad465aa" -LLVM_SHA256 = "c9a50bb272d70f0ee360642d035761b27298afe78adf5c8a30dca50529ac21d6" +LLVM_SHA256 = "3bc65e7a760a389f5ace1146cb2ffde724a272e97e71c8b8509149e827df6c83" http_archive( name = "llvm-raw", diff --git a/build_tools/llvm_version.txt b/build_tools/llvm_version.txt index 20e9923c27d..47e2fdc5df0 100644 --- a/build_tools/llvm_version.txt +++ b/build_tools/llvm_version.txt @@ -1 +1 @@ -eaa95a1c2bd38332c1a4e634595f29d22b28ffea +f0b3287297aeeddcf030e3c1b08d05a69ad465aa diff --git a/stablehlo/conversions/tosa/tests/unary.mlir b/stablehlo/conversions/tosa/tests/unary.mlir index ac0dc1cb47e..a735c337e52 100644 --- a/stablehlo/conversions/tosa/tests/unary.mlir +++ b/stablehlo/conversions/tosa/tests/unary.mlir @@ -121,8 +121,8 @@ func.func @tanh(%arg : tensor<10xf32>) -> tensor<10xf32> { // CHECK-LABEL: @transpose func.func @transpose(%arg0: tensor<1x2x3xf32>) -> tensor<3x2x1xf32> { - // CHECK-DAG: %[[VAR0:.*]] = "tosa.const"() <{value = dense<[2, 1, 0]> : tensor<3xi64>}> : () -> tensor<3xi64> - // CHECK-DAG: %[[VAR1:.*]] = tosa.transpose %arg0, %[[VAR0]] + // CHECK: %[[VAR0:.*]] = "tosa.const"() <{value = dense<[2, 1, 0]> : tensor<3xi32>}> : () -> tensor<3xi32> + // CHECK: %[[VAR1:.*]] = tosa.transpose %arg0, %[[VAR0]] %0 = "stablehlo.transpose"(%arg0) {permutation = array} : (tensor<1x2x3xf32>) -> tensor<3x2x1xf32> return %0 : tensor<3x2x1xf32> } diff --git a/stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.cpp b/stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.cpp index c582693a4af..f43761f617b 100644 --- a/stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.cpp +++ b/stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.cpp @@ -451,9 +451,10 @@ struct ConvertStablehloTransposeOp auto perms = op.getPermutation(); auto type = RankedTensorType::get({static_cast(perms.size())}, - rewriter.getI64Type()); + rewriter.getI32Type()); + std::vector perms_int32(perms.begin(), perms.end()); auto constOp = rewriter.create( - op->getLoc(), type, DenseIntElementsAttr::get(type, perms)); + op->getLoc(), type, DenseIntElementsAttr::get(type, perms_int32)); rewriter.replaceOpWithNewOp(op, op.getType(), op.getOperand(), constOp); return success();