Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Burmako authored Nov 3, 2023
1 parent eec1a58 commit 04291ae
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ http_archive(
],
)

LLVM_COMMIT = "6ae7b735dbd50eb7ade1573a86d037a2943e679c"
LLVM_COMMIT = "46732e2abb34fd7a5c1d52b959d4d07f118479dd"

LLVM_SHA256 = "fb798e60da1f6d55fa44ec9c44e7e8765b33bc23ed4a497e8370d62332be0f5f"
LLVM_SHA256 = "6e493b00b558d5c30dff9d6089747e8e5a355f0111730ff8053863e72fba37bd"

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 @@
6ae7b735dbd50eb7ade1573a86d037a2943e679c
46732e2abb34fd7a5c1d52b959d4d07f118479dd
8 changes: 4 additions & 4 deletions stablehlo/conversions/tosa/tests/nullary.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ func.func @constant_f64() -> tensor<10xf64> {

// CHECK-LABEL: @iota_dimension_0
func.func @iota_dimension_0() -> tensor<4x8xf32> {
// CHECK-DAG: %[[VAR0:.*]] = "tosa.const"() <{value = dense<[0.000000e+00, 1.000000e+00, 2.000000e+00, 3.000000e+00]> : tensor<4xf32>}>
// CHECK-DAG: %[[VAR1:.*]] = tosa.tile %[[VAR0]] {multiples = array<i64: 1, 8>}
// CHECK-DAG: %[[VAR0:.*]] = "tosa.const"()
// CHECK-SAME{LITERAL}: <{value = dense<[[0.000000e+00], [1.000000e+00], [2.000000e+00], [3.000000e+00]]> : tensor<4x1xf32>}>
%0 = "stablehlo.iota"() {iota_dimension = 0 : i64} : () -> (tensor<4x8xf32>)
return %0 : tensor<4x8xf32>
}

// CHECK-LABEL: @iota_dimension_1
func.func @iota_dimension_1() -> tensor<4x8xi32> {
// CHECK-DAG: %[[VAR0:.*]] = "tosa.const"() <{value = dense<[0, 1, 2, 3, 4, 5, 6, 7]> : tensor<8xi32>}>
// CHECK-DAG: %[[VAR1:.*]] = tosa.tile %[[VAR0]] {multiples = array<i64: 4, 1>}
// CHECK-DAG: %[[VAR0:.*]] = "tosa.const"()
// CHECK-SAME{LITERAL}: <{value = dense<[[0, 1, 2, 3, 4, 5, 6, 7]]> : tensor<1x8xi32>}>
%0 = "stablehlo.iota"() {iota_dimension = 1 : i64} : () -> (tensor<4x8xi32>)
return %0 : tensor<4x8xi32>
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ struct ConvertStablehloIotaOp : public OpRewritePattern<stablehlo::IotaOp> {
}
}

RankedTensorType constType =
RankedTensorType::get(iotaArrayLength, elementType);
llvm::SmallVector<int64_t, 4> constShape(resultShape.size(), 1);
constShape[iotaDimension] = resultShape[iotaDimension];
RankedTensorType constType = RankedTensorType::get(constShape, elementType);
auto constOp = rewriter.create<tosa::ConstOp>(
op.getLoc(), constType, DenseElementsAttr::get(constType, constValues));

Expand Down

0 comments on commit 04291ae

Please sign in to comment.