Skip to content

Commit

Permalink
Integrate LLVM at llvm/llvm-project@f0b3287297ae
Browse files Browse the repository at this point in the history
  • Loading branch information
GleasonK committed Sep 13, 2024
1 parent 7e89e4c commit 4cec826
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 = "f0b3287297aeeddcf030e3c1b08d05a69ad465aa"

LLVM_SHA256 = "c9a50bb272d70f0ee360642d035761b27298afe78adf5c8a30dca50529ac21d6"
LLVM_SHA256 = "3bc65e7a760a389f5ace1146cb2ffde724a272e97e71c8b8509149e827df6c83"

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
f0b3287297aeeddcf030e3c1b08d05a69ad465aa
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 4cec826

Please sign in to comment.