diff --git a/tensorflow/compiler/xla/service/cpu/BUILD b/tensorflow/compiler/xla/service/cpu/BUILD index 07c46c27171..676efdf6933 100644 --- a/tensorflow/compiler/xla/service/cpu/BUILD +++ b/tensorflow/compiler/xla/service/cpu/BUILD @@ -558,7 +558,6 @@ cc_library( "//tensorflow/core:lib", "@com_google_absl//absl/strings", "@llvm-project//llvm:Core", - "@llvm-project//mlir:EDSC", "@llvm-project//mlir:IR", "@llvm-project//mlir:LinalgOps", "@llvm-project//mlir:LinalgTransforms", diff --git a/tensorflow/compiler/xla/service/cpu/dot_op_emitter.cc b/tensorflow/compiler/xla/service/cpu/dot_op_emitter.cc index 367df07c1f4..b1b51ed87fc 100644 --- a/tensorflow/compiler/xla/service/cpu/dot_op_emitter.cc +++ b/tensorflow/compiler/xla/service/cpu/dot_op_emitter.cc @@ -24,8 +24,7 @@ limitations under the License. #include "llvm/IR/Module.h" #include "llvm/IR/Value.h" #include "mlir/Dialect/Linalg/Transforms/CodegenStrategy.h" // from @llvm-project -#include "mlir/Dialect/StandardOps/EDSC/Intrinsics.h" // from @llvm-project -#include "mlir/EDSC/Builders.h" // from @llvm-project +#include "mlir/Dialect/StandardOps/Utils/Utils.h" // from @llvm-project #include "mlir/IR/Builders.h" // from @llvm-project #include "mlir/IR/BuiltinOps.h" // from @llvm-project #include "mlir/IR/MLIRContext.h" // from @llvm-project @@ -305,26 +304,6 @@ Status DotOpEmitter::EmitLinalgMatmul() { llvm::SmallVector iteratorTypes( parallel_exprs.size(), toString(mlir::IteratorType::Parallel)); iteratorTypes.push_back(toString(mlir::IteratorType::Reduction)); - /// Helper struct to build simple arithmetic quantities with minimal - /// type inference support. - /// TODO: reuse the core abstraction once it is in a reusable location. - struct ArithBuilder { - ArithBuilder(mlir::OpBuilder& b, mlir::Location loc) - : b(b), loc(loc) {} - mlir::Value add(mlir::Value lhs, mlir::Value rhs) { - if (lhs.getType().isa()) - return b.create(loc, lhs, rhs); - return b.create(loc, lhs, rhs); - } - mlir::Value mul(mlir::Value lhs, mlir::Value rhs) { - if (lhs.getType().isa()) - return b.create(loc, lhs, rhs); - return b.create(loc, lhs, rhs); - } - - mlir::OpBuilder& b; - mlir::Location loc; - }; builder->create( function.getLoc(), /*inputs=*/mlir::ValueRange{b, c}, @@ -334,7 +313,7 @@ Status DotOpEmitter::EmitLinalgMatmul() { {b_exprs, c_exprs, parallel_exprs}), /*iteratorTypes=*/iteratorTypes, [](mlir::OpBuilder& b, mlir::Location loc, mlir::ValueRange args) { - ArithBuilder ab(b, loc); + mlir::ArithBuilder ab(b, loc); mlir::Value mul = ab.mul(args[0], args[1]); mlir::Value add = ab.add(mul, args[2]); b.create(loc, add); diff --git a/third_party/llvm/workspace.bzl b/third_party/llvm/workspace.bzl index 77d61a3fd79..7f47fa96198 100644 --- a/third_party/llvm/workspace.bzl +++ b/third_party/llvm/workspace.bzl @@ -4,8 +4,8 @@ load("//third_party:repo.bzl", "tf_http_archive") def repo(name): """Imports LLVM.""" - LLVM_COMMIT = "eb6429d0fb94fd467e03d229177ae6ff3a44e3cc" - LLVM_SHA256 = "dfd4ba4e5454037971938958646d2d597d33e2807cf5b7a0368c6b730e171dc7" + LLVM_COMMIT = "d65c32fb41b03a35a2a16330ba1ea15cf6818f04" + LLVM_SHA256 = "1afe601db1da5c07805313afcba9eb39e32fbfa57de122848f063ba0f9d68d03" tf_http_archive( name = name, diff --git a/third_party/mlir/BUILD b/third_party/mlir/BUILD index b2c9cfacb45..43df3b6e7e9 100644 --- a/third_party/mlir/BUILD +++ b/third_party/mlir/BUILD @@ -243,19 +243,6 @@ cc_library( ], ) -# TODO(ntv): Update these to enable simplifying the cmake and build files. -cc_library( - name = "EDSC", - srcs = ["lib/EDSC/Builders.cpp"], - hdrs = ["include/mlir/EDSC/Builders.h"], - includes = ["include"], - deps = [ - ":IR", - ":Support", - "@llvm-project//llvm:Support", - ], -) - cc_library( name = "CAPIIR", srcs = [ @@ -1992,7 +1979,6 @@ cc_library( [ "lib/Dialect/StandardOps/IR/*.cpp", "lib/Dialect/StandardOps/IR/*.h", - "lib/Dialect/StandardOps/EDSC/*.cpp", "lib/Dialect/StandardOps/Utils/*.cpp", ], ) + @@ -2002,7 +1988,6 @@ cc_library( ], hdrs = glob([ "include/mlir/Dialect/StandardOps/IR/*.h", - "include/mlir/Dialect/StandardOps/EDSC/*.h", "include/mlir/Dialect/StandardOps/Utils/*.h", ]) + ["include/mlir/Transforms/InliningUtils.h"], includes = ["include"], @@ -2012,7 +1997,6 @@ cc_library( ":CommonFolders", ":ControlFlowInterfaces", ":CopyOpInterface", # TODO: Stop depending on MemRefOps. - ":EDSC", ":IR", ":MemRefBaseIncGen", # TODO: Stop depending on MemRefOps. ":MemRefOpsIncGen", # TODO: Stop depending on MemRefOps. @@ -2442,7 +2426,6 @@ cc_library( includes = ["include"], deps = [ ":Async", - ":EDSC", ":GPUDialect", ":GPUPassIncGen", ":MemRefDialect", @@ -2537,8 +2520,8 @@ cc_library( ":GPUToNVVMGen", ":GPUTransforms", ":IR", + ":LLVMDialect", ":MathDialect", - ":MemRefDialect", ":NVVMDialect", ":Pass", ":StandardToLLVM", @@ -3544,7 +3527,6 @@ cc_library( includes = ["include"], deps = [ ":Async", - ":EDSC", ":IR", ":MemRefDialect", ":ParallelLoopMapperAttrGen", @@ -5419,7 +5401,6 @@ cc_library( ":AffineToStandard", ":Analysis", ":ConversionPassIncGen", - ":EDSC", ":IR", ":LLVMDialect", ":LinalgOps", @@ -5578,7 +5559,6 @@ cc_library( ":Analysis", ":ComplexDialect", ":DialectUtils", - ":EDSC", ":IR", ":LinalgOps", ":LinalgPassIncGen", @@ -6100,13 +6080,11 @@ cc_library( ], ), hdrs = [ - "include/mlir/Dialect/Math/EDSC/Intrinsics.h", "include/mlir/Dialect/Math/IR/Math.h", "include/mlir/Transforms/InliningUtils.h", ], includes = ["include"], deps = [ - ":EDSC", ":IR", ":MathBaseIncGen", ":MathOpsIncGen", @@ -6231,7 +6209,6 @@ cc_library( includes = ["include"], deps = [ ":CopyOpInterface", - ":EDSC", ":IR", ":InferTypeOpInterface", ":MemRefBaseIncGen",