Skip to content

Commit

Permalink
Integrate LLVM at llvm/llvm-project@36adf8ecedb6
Browse files Browse the repository at this point in the history
  • Loading branch information
sdasgup3 committed Sep 16, 2024
1 parent 7f88b35 commit 939a439
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ workspace(name = "stablehlo")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

LLVM_COMMIT = "eaa95a1c2bd38332c1a4e634595f29d22b28ffea"
LLVM_COMMIT = "36adf8ecedb64047021265a1e1730773d3b3a9e8"

LLVM_SHA256 = "c9a50bb272d70f0ee360642d035761b27298afe78adf5c8a30dca50529ac21d6"
LLVM_SHA256 = "7baedfc21f67f64f054482cbe77cb3049cd4428187cd45799e10ff8eb03dc9f6"

http_archive(
name = "llvm-raw",
Expand Down
2 changes: 1 addition & 1 deletion build_tools/llvm_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eaa95a1c2bd38332c1a4e634595f29d22b28ffea
36adf8ecedb64047021265a1e1730773d3b3a9e8
4 changes: 2 additions & 2 deletions stablehlo/conversions/tosa/tests/unary.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -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<i64: 2, 1, 0>} : (tensor<1x2x3xf32>) -> tensor<3x2x1xf32>
return %0 : tensor<3x2x1xf32>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,10 @@ struct ConvertStablehloTransposeOp

auto perms = op.getPermutation();
auto type = RankedTensorType::get({static_cast<int64_t>(perms.size())},
rewriter.getI64Type());
rewriter.getI32Type());
std::vector<int32_t> perms_int32(perms.begin(), perms.end());
auto constOp = rewriter.create<tosa::ConstOp>(
op->getLoc(), type, DenseIntElementsAttr::get(type, perms));
op->getLoc(), type, DenseIntElementsAttr::get(type, perms_int32));
rewriter.replaceOpWithNewOp<tosa::TransposeOp>(op, op.getType(),
op.getOperand(), constOp);
return success();
Expand Down

0 comments on commit 939a439

Please sign in to comment.