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@ba4cf31f (#404)
Browse files Browse the repository at this point in the history
Updates LLVM usage to match llvm/llvm-project@ba4cf31f. Further updates
the StableHLO submodule to openxla/stablehlo@11804dd.

This also renames the CMake target `MLIREmitCTransforms` to
`MLIREmitCTransformsLocal` as the former is now defined upstream.
  • Loading branch information
marbre authored Jan 15, 2024
1 parent f9683c2 commit 5ff6f74
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build_tools/llvm_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b2cdf3cc4c08729d0ff582d55e40793a20bbcdcc
ba4cf31facdaf9bb9943c057d325ff0968331e9a
2 changes: 1 addition & 1 deletion include/emitc/Dialect/EmitC/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls -name EmitC)
mlir_tablegen(Passes.h.inc -gen-pass-decls -name EmitCLocal)
add_public_tablegen_target(MLIREmitCPassIncGen)
16 changes: 8 additions & 8 deletions lib/Conversion/StablehloToEmitC/StablehloRegionOpsToEmitC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ struct ConvertStablehloRegionOpsToEmitCPass
SmallVector<Attribute, 2> arguments =
indexSequence(operands.size(), op.getContext());

arguments.push_back(op.getDimensions());
arguments.push_back(builder.getI64TensorAttr(op.getDimensions()));
arguments.push_back(SymbolRefAttr::get(ctx, funcOp.getName()));

ArrayAttr args = ArrayAttr::get(ctx, arguments);
Expand Down Expand Up @@ -192,13 +192,13 @@ struct ConvertStablehloRegionOpsToEmitCPass
SmallVector<Attribute, 2> arguments = indexSequence(operands.size(), ctx);

size_t dim = op.getResult(0).getType().cast<RankedTensorType>().getRank();
arguments.push_back(op.getWindowDimensions());
arguments.push_back(op.getWindowStrides().value_or(
builder.getI64TensorAttr(SmallVector<int64_t>(dim, 1))));
arguments.push_back(op.getBaseDilations().value_or(
builder.getI64TensorAttr(SmallVector<int64_t>(dim, 1))));
arguments.push_back(op.getBaseDilations().value_or(
builder.getI64TensorAttr(SmallVector<int64_t>(dim, 1))));
arguments.push_back(builder.getI64TensorAttr(op.getWindowDimensions()));
arguments.push_back(builder.getI64TensorAttr(
op.getWindowStrides().value_or(SmallVector<int64_t>(dim, 1))));
arguments.push_back(builder.getI64TensorAttr(
op.getBaseDilations().value_or(SmallVector<int64_t>(dim, 1))));
arguments.push_back(builder.getI64TensorAttr(
op.getBaseDilations().value_or(SmallVector<int64_t>(dim, 1))));
arguments.push_back(op.getPadding().value_or(
builder.getI64TensorAttr(SmallVector<int64_t>(2 * dim, 0))));
arguments.push_back(SymbolRefAttr::get(ctx, funcOp.getName()));
Expand Down
13 changes: 6 additions & 7 deletions lib/Conversion/StablehloToEmitC/StablehloToEmitC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,14 @@ class ConvOpConversion : public OpConversionPattern<stablehlo::ConvolutionOp> {
arguments.push_back(rewriter.getI64TensorAttr(
convOp.getDimensionNumbers().getOutputSpatialDimensions()));
arguments.push_back(convOp.getFeatureGroupCountAttr());

arguments.push_back(convOp.getPadding().value_or(
rewriter.getI64TensorAttr(SmallVector<int64_t>(2, 0))));
arguments.push_back(convOp.getLhsDilation().value_or(
rewriter.getI64TensorAttr(SmallVector<int64_t>(2, 1))));
arguments.push_back(convOp.getRhsDilation().value_or(
rewriter.getI64TensorAttr(SmallVector<int64_t>(2, 1))));
arguments.push_back(convOp.getWindowStrides().value_or(
rewriter.getI64TensorAttr(SmallVector<int64_t>(2, 1))));
arguments.push_back(rewriter.getI64TensorAttr(
convOp.getLhsDilation().value_or((SmallVector<int64_t>(2, 1)))));
arguments.push_back(rewriter.getI64TensorAttr(
convOp.getRhsDilation().value_or((SmallVector<int64_t>(2, 1)))));
arguments.push_back(rewriter.getI64TensorAttr(
convOp.getWindowStrides().value_or((SmallVector<int64_t>(2, 1)))));

ArrayAttr args = rewriter.getArrayAttr(arguments);
ArrayAttr templateArgs =
Expand Down
2 changes: 1 addition & 1 deletion lib/Dialect/EmitC/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_mlir_library(MLIREmitCTransforms
add_mlir_library(MLIREmitCTransformsLocal
InsertIncludes.cpp

DEPENDS
Expand Down
2 changes: 1 addition & 1 deletion third_party/stablehlo
Submodule stablehlo updated 56 files
+2 −2 .github/actions/setup-build/action.yml
+1 −1 .github/workflows/buildAndTestBazel.yml
+1 −1 .github/workflows/buildAndTestCMake.yml
+3 −3 .github/workflows/lint.yml
+1 −1 .github/workflows/markdown_lint.yml
+7 −6 BUILD.bazel
+2 −2 WORKSPACE.bazel
+1 −1 build_tools/llvm_version.txt
+8 −8 docs/spec.md
+7 −7 stablehlo/conversions/linalg/transforms/StablehloLegalizeToLinalg.cpp
+18 −15 stablehlo/conversions/linalg/transforms/StablehloToLinalgConvolution.cpp
+17 −19 stablehlo/conversions/linalg/transforms/StablehloToLinalgReduce.cpp
+1 −1 stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.cpp
+30 −0 stablehlo/dialect/Base.cpp
+22 −0 stablehlo/dialect/Base.h
+13 −6 stablehlo/dialect/Base.td
+5 −3 stablehlo/dialect/BroadcastUtils.cpp
+1 −1 stablehlo/dialect/BroadcastUtils.h
+1 −0 stablehlo/dialect/CMakeLists.txt
+6 −6 stablehlo/dialect/ChloOps.cpp
+6 −6 stablehlo/dialect/ChloOps.td
+3 −1 stablehlo/dialect/Register.cpp
+22 −32 stablehlo/dialect/StablehloAttrs.td
+56 −63 stablehlo/dialect/StablehloOps.cpp
+8 −9 stablehlo/dialect/StablehloOps.h
+33 −36 stablehlo/dialect/StablehloOps.td
+186 −128 stablehlo/dialect/TypeInference.cpp
+31 −29 stablehlo/dialect/TypeInference.h
+1 −1 stablehlo/dialect/Version.h
+1 −0 stablehlo/dialect/VhloDialect.td
+72 −0 stablehlo/dialect/VhloOps.cpp
+23 −6 stablehlo/dialect/VhloOps.td
+23 −0 stablehlo/reference/Api.cpp
+9 −0 stablehlo/reference/Api.h
+1 −0 stablehlo/reference/CMakeLists.txt
+9 −13 stablehlo/reference/Ops.cpp
+3 −3 stablehlo/tests/infer_chlo.mlir
+134 −27 stablehlo/tests/infer_stablehlo.mlir
+2 −2 stablehlo/tests/ops_chlo_roundtrip.mlir
+1 −1 stablehlo/tests/ops_sparse.mlir
+184 −9 stablehlo/tests/ops_stablehlo.mlir
+1 −1 stablehlo/tests/ops_stablehlo_roundtrip.mlir
+4 −10 stablehlo/tests/print_reduce.mlir
+2,410 −0 stablehlo/tests/stablehlo_legalize_to_vhlo.0_17_0.mlir
+ stablehlo/tests/stablehlo_legalize_to_vhlo.0_17_0.mlir.bc
+125 −0 stablehlo/tests/stablehlo_legalize_to_vhlo.mlir
+100 −4 stablehlo/tests/verify_reduce.mlir
+123 −7 stablehlo/tests/verify_reduce_window.mlir
+151 −2 stablehlo/tests/verify_scatter.mlir
+141 −2 stablehlo/tests/verify_select_and_scatter.mlir
+6 −6 stablehlo/tests/verify_while.mlir
+123 −0 stablehlo/tests/vhlo_to_version_downgrade_invalid.0_16_0.mlir
+1 −0 stablehlo/transforms/CMakeLists.txt
+13 −0 stablehlo/transforms/StablehloLegalizeToVhlo.cpp
+21 −15 stablehlo/transforms/VhloLegalizeToStablehlo.cpp
+11 −1 stablehlo/transforms/VhloToVersion.cpp
2 changes: 1 addition & 1 deletion tools/emitc-opt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ set(LIBS
MLIRArithToEmitC
MLIRTensorToEmitC
MLIRTosaToEmitC
MLIREmitCTransforms
MLIREmitCTransformsLocal
MLIREmitCPipelines
${HLO_LIBS}
)
Expand Down

0 comments on commit 5ff6f74

Please sign in to comment.