Skip to content

Commit

Permalink
Integrate llvm-project and bump dependencies
Browse files Browse the repository at this point in the history
* llvm-project: eb27da7dec67f1a36505b589b786ba1a499c274a
* mlir-hlo: 6643eac37609bdf91409627279d8b5ae28acf39c
* tensorflow: fddb6c72caa6a63ec86263a4d4230812c861cd10.

Rename Standard dialect of Func dialect and add missing dependencies to HAL/LLVM_AOT target
  • Loading branch information
ThomasRaoux authored Mar 4, 2022
1 parent 74cab16 commit 5e2d790
Show file tree
Hide file tree
Showing 283 changed files with 504 additions and 482 deletions.
2 changes: 1 addition & 1 deletion build_tools/bazel_to_cmake/bazel_to_cmake_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@llvm-project//mlir:MemRefDialect": ["MLIRMemRef"],
"@llvm-project//mlir:SCFToGPUPass": ["MLIRSCFToGPU"],
"@llvm-project//mlir:SCFDialect": ["MLIRSCF"],
"@llvm-project//mlir:StandardOps": ["MLIRStandard"],
"@llvm-project//mlir:FuncDialect": ["MLIRFunc"],
"@llvm-project//mlir:ShapeTransforms": ["MLIRShapeOpsTransforms"],
"@llvm-project//mlir:SideEffects": ["MLIRSideEffectInterfaces"],
"@llvm-project//mlir:SPIRVDialect": ["MLIRSPIRV"],
Expand Down
2 changes: 1 addition & 1 deletion integrations/tensorflow/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

TENSORFLOW_COMMIT = "62b8d4dd3f9e09810f4b2ab65d875dabce33548e"
TENSORFLOW_COMMIT = "fddb6c72caa6a63ec86263a4d4230812c861cd10"

git_repository(
name = "org_tensorflow",
Expand Down
8 changes: 4 additions & 4 deletions integrations/tensorflow/iree-dialects/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,14 @@ cc_library(
"@llvm-project//mlir:ArithmeticUtils",
"@llvm-project//mlir:ControlFlowInterfaces",
"@llvm-project//mlir:DialectUtils",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:LinalgOps",
"@llvm-project//mlir:MathDialect",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:SCFDialect",
"@llvm-project//mlir:SideEffectInterfaces",
"@llvm-project//mlir:StandardOps",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:TensorUtils",
Expand All @@ -301,6 +301,7 @@ cc_library(
"@llvm-project//mlir:Affine",
"@llvm-project//mlir:ArithmeticDialect",
"@llvm-project//mlir:DialectUtils",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:LinalgOps",
"@llvm-project//mlir:LinalgTransforms",
Expand All @@ -309,7 +310,6 @@ cc_library(
"@llvm-project//mlir:Parser",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:SCFDialect",
"@llvm-project//mlir:StandardOps",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:TensorUtils",
Expand Down Expand Up @@ -480,11 +480,11 @@ cc_library(
"@llvm-project//mlir:ArithmeticDialect",
"@llvm-project//mlir:ControlFlowInterfaces",
"@llvm-project//mlir:ControlFlowOps",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:MathDialect",
"@llvm-project//mlir:Parser",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:StandardOps",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TransformUtils",
"@llvm-project//mlir:Transforms",
Expand Down Expand Up @@ -528,12 +528,12 @@ cc_binary(
":IREEPyDMTransforms",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:ArithmeticDialect",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:LinalgOps",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:MlirOptLib",
"@llvm-project//mlir:SCFDialect",
"@llvm-project//mlir:StandardOps",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:Transforms",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ add_mlir_library(IREELinalgExtDialect
MLIRSideEffectInterfaces
MLIRSupport
MLIRSCF
MLIRStandard
MLIRFunc
MLIRTensor
MLIRViewLikeInterface
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#include "llvm/Support/SMLoc.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arithmetic/Utils/Utils.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Utils/StructuredOpsUtils.h"
#include "mlir/IR/Attributes.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/Support/Debug.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ add_mlir_library(IREELinalgExtPasses
MLIRMemRef
MLIRPass
MLIRSCF
MLIRStandard
MLIRFunc
MLIRSupport
MLIRTensor
MLIRTransforms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"
Expand Down Expand Up @@ -91,7 +91,7 @@ namespace {
struct LinalgExtToLoopsPass
: public LinalgExtToLoopsBase<LinalgExtToLoopsPass> {
void getDependentDialects(DialectRegistry &registry) const override {
registry.insert<linalg::LinalgDialect, StandardOpsDialect,
registry.insert<linalg::LinalgDialect, func::FuncDialect,
mlir::arith::ArithmeticDialect, math::MathDialect,
memref::MemRefDialect, scf::SCFDialect>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
#include "iree-dialects/Dialect/LinalgExt/Transforms/Transforms.h"
#include "llvm/ADT/TypeSwitch.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/IR/Matchers.h"
Expand Down Expand Up @@ -262,7 +262,7 @@ struct TiledOpInterfaceTilingPass
registry.insert<
AffineDialect, IREE::Input::IREEInputDialect, linalg::LinalgDialect,
IREE::LinalgExt::IREELinalgExtDialect, memref::MemRefDialect,
StandardOpsDialect, mlir::arith::ArithmeticDialect, math::MathDialect,
func::FuncDialect, mlir::arith::ArithmeticDialect, math::MathDialect,
tensor::TensorDialect, scf::SCFDialect>();
}
void runOnOperation() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/Debug.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/Dominance.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ add_mlir_library(IREEPyDMRTLPasses
IREEPyDMDialect
MLIRIR
MLIRParser
MLIRStandard
MLIRFunc
MLIRTransformUtils
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "iree-dialects/Dialect/Input/InputOps.h"
#include "iree-dialects/Dialect/PyDM/IR/PyDMOps.h"
#include "iree-dialects/Dialect/PyDM/Transforms/Passes.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/BuiltinDialect.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"

Expand Down Expand Up @@ -222,7 +222,7 @@ struct LowerIREEPyDMToRTLPass
: public LowerIREEPyDMToRTLBase<LowerIREEPyDMToRTLPass> {
void getDependentDialects(DialectRegistry &registry) const override {
registry.insert<mlir::iree_compiler::IREE::Input::IREEInputDialect,
BuiltinDialect, StandardOpsDialect>();
BuiltinDialect, func::FuncDialect>();
}

void runOnOperation() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add_mlir_library(IREEPyDMToIREEPasses
MLIRControlFlow
MLIRIR
MLIRMath
MLIRStandard
MLIRFunc
MLIRTransformUtils
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "iree-dialects/Dialect/PyDM/Transforms/ToIREE/TypeConverter.h"
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/IR/BuiltinDialect.h"

using namespace mlir;
Expand All @@ -27,7 +27,7 @@ struct ConvertIREEPyDMToIREEPass
: public ConvertIREEPyDMToIREEBase<ConvertIREEPyDMToIREEPass> {
void getDependentDialects(DialectRegistry &registry) const override {
registry.insert<mlir::iree_compiler::IREE::Input::IREEInputDialect,
BuiltinDialect, StandardOpsDialect, math::MathDialect>();
BuiltinDialect, func::FuncDialect, math::MathDialect>();
}

void runOnOperation() override {
Expand All @@ -44,7 +44,7 @@ struct ConvertIREEPyDMToIREEPass
.addLegalDialect<mlir::iree_compiler::IREE::Input::IREEInputDialect>();
target.addLegalDialect<mlir::arith::ArithmeticDialect>();
target.addLegalDialect<mlir::math::MathDialect>();
target.addLegalDialect<mlir::StandardOpsDialect>();
target.addLegalDialect<mlir::func::FuncDialect>();

// Some CFG ops can be present in the original pydm program. Need to
// verify legality based on types.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "iree-dialects/Dialect/PyDM/Transforms/ToIREE/Patterns.h"
#include "llvm/ADT/TypeSwitch.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Support/LLVM.h"
Expand Down Expand Up @@ -463,8 +463,8 @@ class CallOpConversion : public OpConversionPattern<PYDM::CallOp> {
return rewriter.notifyMatchFailure(srcOp,
"result types could not be converted");
}
rewriter.replaceOpWithNewOp<mlir::CallOp>(srcOp, srcOp.callee(),
resultTypes, adaptor.operands());
rewriter.replaceOpWithNewOp<mlir::func::CallOp>(
srcOp, srcOp.callee(), resultTypes, adaptor.operands());
return success();
}
};
Expand Down Expand Up @@ -856,7 +856,8 @@ class RaiseOnFailureOpConversion
// Raise and return block.
rewriter.setInsertionPointToEnd(raiseAndReturnBlock);
auto nullReturnValue = getNullValue(loc, rewriter, convertedReturnType);
rewriter.create<mlir::ReturnOp>(loc, ValueRange{status, nullReturnValue});
rewriter.create<mlir::func::ReturnOp>(loc,
ValueRange{status, nullReturnValue});
return success();
}
};
Expand All @@ -871,7 +872,7 @@ class ReturnOpConversion : public OpConversionPattern<PYDM::ReturnOp> {
auto loc = srcOp.getLoc();
auto zeroResult =
rewriter.create<arith::ConstantOp>(loc, rewriter.getI32IntegerAttr(0));
rewriter.replaceOpWithNewOp<mlir::ReturnOp>(
rewriter.replaceOpWithNewOp<mlir::func::ReturnOp>(
srcOp, ValueRange{zeroResult, adaptor.getOperands()[0]});
return success();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_mlir_library(IREEPyDMUtils
LINK_LIBS PUBLIC
IREEPyDMDialect
MLIRIR
MLIRStandard
MLIRFunc
MLIRTransformUtils
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ set(_source_components
# build burden by ~5x. Make it stop.
MLIRPythonSources.Core
MLIRPythonSources.Dialects.builtin
MLIRPythonSources.Dialects.std
MLIRPythonSources.Dialects.func
MLIRPythonSources.Passes
IREEDialectsPythonSources
IREEDialectsPythonExtensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(LIBS
MLIROptLib
MLIRSCF
MLIRSCFTransforms
MLIRStandard
MLIRFunc
MLIRTensor
MLIRTransforms
IREEInputDialect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#include "iree-dialects/Dialect/PyDM/IR/PyDMDialect.h"
#include "iree-dialects/Dialect/PyDM/Transforms/Passes.h"
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/Passes.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/IR/AsmState.h"
#include "mlir/IR/Dialect.h"
Expand Down Expand Up @@ -44,7 +44,7 @@ int main(int argc, char **argv) {
mlir::iree_compiler::IREE::PYDM::IREEPyDMDialect,
// Upstream dialects
mlir::arith::ArithmeticDialect, mlir::linalg::LinalgDialect,
mlir::memref::MemRefDialect, mlir::StandardOpsDialect,
mlir::memref::MemRefDialect, mlir::func::FuncDialect,
mlir::scf::SCFDialect, mlir::tensor::TensorDialect>();

IREE::LinalgExt::registerTiledOpInterfaceExternalModels(registry);
Expand Down
4 changes: 2 additions & 2 deletions integrations/tensorflow/iree_tf_compiler/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ cc_binary(
deps = [
"//iree_tf_compiler/TFL",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:MlirOptLib",
"@llvm-project//mlir:QuantOps",
"@llvm-project//mlir:StandardOps",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TosaDialect",
"@org_tensorflow//tensorflow/compiler/mlir/lite:tensorflow_lite",
Expand Down Expand Up @@ -112,11 +112,11 @@ cc_binary(
deps = [
"//iree_tf_compiler/MHLO",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:MathDialect",
"@llvm-project//mlir:Parser",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:StandardOps",
"@llvm-project//mlir:Support",
"@org_tensorflow//tensorflow/compiler/mlir/hlo:hlo_dialect_registration",
"@org_tensorflow//tensorflow/compiler/mlir/xla:hlo_to_mlir_hlo",
Expand Down
2 changes: 1 addition & 1 deletion integrations/tensorflow/iree_tf_compiler/MHLO/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ cc_library(
],
deps = [
"@llvm-project//llvm:Support",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:SCFToStandard",
"@llvm-project//mlir:SCFTransforms",
"@llvm-project//mlir:Shape",
"@llvm-project//mlir:ShapeTransforms",
"@llvm-project//mlir:StandardOps",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:TransformUtils",
Expand Down
2 changes: 1 addition & 1 deletion integrations/tensorflow/iree_tf_compiler/TF/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ cc_library(
"//iree_tf_compiler/MHLO",
"//iree_tf_compiler/Utils",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:LinalgOps",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:MemRefTransforms",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:Shape",
"@llvm-project//mlir:ShapeTransforms",
"@llvm-project//mlir:StandardOps",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:TransformUtils",
Expand Down
Loading

0 comments on commit 5e2d790

Please sign in to comment.