Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Integrate LLVM at llvm/llvm-project@b2cdf3cc (#401)
Browse files Browse the repository at this point in the history
Updates LLVM usage to match llvm/llvm-project@b2cdf3cc. Further updates
the StableHLO submodule to openxla/stablehlo@3bdd859.
  • Loading branch information
marbre authored Jan 11, 2024
1 parent fe63c69 commit 7d568bd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build_tools/llvm_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d1a83ff3e0274f26746e874d480c866bec3818d6
b2cdf3cc4c08729d0ff582d55e40793a20bbcdcc
3 changes: 2 additions & 1 deletion lib/Conversion/StablehloToEmitC/StablehloToEmitC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ class BroadcastInDimOpConversion
SmallVector<Attribute, 2> arguments = indexSequence(
adaptor.getOperands().size(), broadcastInDimOp.getContext());

arguments.push_back(broadcastInDimOp.getBroadcastDimensions());
arguments.push_back(
rewriter.getI64TensorAttr(broadcastInDimOp.getBroadcastDimensions()));

ArrayAttr args = rewriter.getArrayAttr(arguments);

Expand Down
2 changes: 1 addition & 1 deletion test/Conversion/stablehlo-to-emitc.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func.func @stablehlo_bitcast_convert(%arg0: tensor<ui32>) -> tensor<i32> {

func.func @stablehlo_broadcast_in_dim(%arg0: tensor<i32>) -> tensor<3xi32> {
// CHECK: emitc.call_opaque "emitc::stablehlo::broadcast_in_dim"(%arg0) {args = [0 : index, dense<> : tensor<0xi64>], template_args = [tensor<3xi32>]} : (tensor<i32>) -> tensor<3xi32>
%0 = "stablehlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = dense<> : tensor<0xi64>} : (tensor<i32>) -> tensor<3xi32>
%0 = "stablehlo.broadcast_in_dim"(%arg0) {broadcast_dimensions = array<i64>} : (tensor<i32>) -> tensor<3xi32>
return %0 : tensor<3xi32>
}

Expand Down
4 changes: 2 additions & 2 deletions test/MobileNetV2_FakeWeights_stablehlo.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ module attributes {tf.versions = {bad_consumers = [], min_consumer = 12 : i32, p
%210 = stablehlo.maximum %arg1, %arg2 : tensor<f32>
"stablehlo.return"(%210) : (tensor<f32>) -> ()
}) {dimensions = dense<1> : tensor<1xi64>} : (tensor<1x1000xf32>, tensor<f32>) -> tensor<1xf32>
%204 = "stablehlo.broadcast_in_dim"(%203) {broadcast_dimensions = dense<0> : tensor<1xi64>} : (tensor<1xf32>) -> tensor<1x1000xf32>
%204 = "stablehlo.broadcast_in_dim"(%203) {broadcast_dimensions = array<i64: 0>} : (tensor<1xf32>) -> tensor<1x1000xf32>
%205 = stablehlo.subtract %202, %204 : tensor<1x1000xf32>
%206 = "stablehlo.exponential"(%205) : (tensor<1x1000xf32>) -> tensor<1x1000xf32>
%207 = "stablehlo.reduce"(%206, %43) ( {
^bb0(%arg1: tensor<f32>, %arg2: tensor<f32>): // no predecessors
%210 = stablehlo.add %arg1, %arg2 : tensor<f32>
"stablehlo.return"(%210) : (tensor<f32>) -> ()
}) {dimensions = dense<1> : tensor<1xi64>} : (tensor<1x1000xf32>, tensor<f32>) -> tensor<1xf32>
%208 = "stablehlo.broadcast_in_dim"(%207) {broadcast_dimensions = dense<0> : tensor<1xi64>} : (tensor<1xf32>) -> tensor<1x1000xf32>
%208 = "stablehlo.broadcast_in_dim"(%207) {broadcast_dimensions = array<i64: 0>} : (tensor<1xf32>) -> tensor<1x1000xf32>
%209 = stablehlo.divide %206, %208 : tensor<1x1000xf32>
return %209 : tensor<1x1000xf32>
}
Expand Down
2 changes: 1 addition & 1 deletion third_party/stablehlo
Submodule stablehlo updated 39 files
+14 −0 .bazelversion
+28 −0 BUILD.bazel
+2 −2 WORKSPACE.bazel
+1 −1 build_tools/llvm_version.txt
+1 −1 docs/spec.md
+1 −1 stablehlo/api/PortableApi.h
+5 −5 stablehlo/conversions/linalg/tests/miscellaneous.mlir
+19 −31 stablehlo/conversions/linalg/transforms/StablehloLegalizeToLinalg.cpp
+17 −0 stablehlo/dialect/AssemblyFormat.cpp
+13 −0 stablehlo/dialect/AssemblyFormat.h
+2 −0 stablehlo/dialect/CMakeLists.txt
+16 −7 stablehlo/dialect/StablehloAttrs.td
+12 −11 stablehlo/dialect/StablehloOps.cpp
+3 −6 stablehlo/dialect/StablehloOps.h
+9 −8 stablehlo/dialect/StablehloOps.td
+30 −0 stablehlo/dialect/StablehloTypes.td
+13 −26 stablehlo/dialect/TypeInference.cpp
+4 −5 stablehlo/dialect/TypeInference.h
+1 −1 stablehlo/dialect/Version.h
+0 −1 stablehlo/dialect/VhloAttrs.td
+1 −1 stablehlo/dialect/VhloDialect.td
+1 −1 stablehlo/dialect/VhloTypes.td
+2 −2 stablehlo/tests/infer_chlo.mlir
+1 −1 stablehlo/tests/interpret_broadcast_in_dim.mlir
+38 −19 stablehlo/tests/ops_stablehlo.mlir
+1 −1 stablehlo/tests/ops_stablehlo_roundtrip.mlir
+1 −1 stablehlo/tests/print_stablehlo.mlir
+5 −5 stablehlo/tests/stablehlo_legalize_to_vhlo.0_10_0.mlir
+5 −5 stablehlo/tests/stablehlo_legalize_to_vhlo.0_11_0.mlir
+5 −5 stablehlo/tests/stablehlo_legalize_to_vhlo.0_12_0.mlir
+5 −5 stablehlo/tests/stablehlo_legalize_to_vhlo.0_13_0.mlir
+5 −5 stablehlo/tests/stablehlo_legalize_to_vhlo.0_14_0.mlir
+5 −5 stablehlo/tests/stablehlo_legalize_to_vhlo.0_15_0.mlir
+5 −5 stablehlo/tests/stablehlo_legalize_to_vhlo.0_16_0.mlir
+5 −5 stablehlo/tests/stablehlo_legalize_to_vhlo.0_9_0.mlir
+5 −5 stablehlo/tests/stablehlo_legalize_to_vhlo.mlir
+11 −11 stablehlo/tests/verify_while.mlir
+2 −1 stablehlo/transforms/StablehloCanonicalizeDynamism.cpp
+11 −0 stablehlo/transforms/VhloLegalizeToStablehlo.cpp

0 comments on commit 7d568bd

Please sign in to comment.