Updates LLVM usage to match
[d65c32fb41b0](https://github.com/llvm/llvm-project/commit/d65c32fb41b0)

PiperOrigin-RevId: 375537865
Change-Id: I91152346f59e770926a2f8ace1c3241094ce1f90
This commit is contained in:
A. Unique TensorFlower
2021-05-24 12:56:31 -07:00
committed by TensorFlower Gardener
parent df499fc62d
commit b949f47bb4
4 changed files with 5 additions and 50 deletions

View File

@@ -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",

View File

@@ -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<llvm::StringRef, 4> 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<mlir::IntegerType>())
return b.create<mlir::AddIOp>(loc, lhs, rhs);
return b.create<mlir::AddFOp>(loc, lhs, rhs);
}
mlir::Value mul(mlir::Value lhs, mlir::Value rhs) {
if (lhs.getType().isa<mlir::IntegerType>())
return b.create<mlir::MulIOp>(loc, lhs, rhs);
return b.create<mlir::MulFOp>(loc, lhs, rhs);
}
mlir::OpBuilder& b;
mlir::Location loc;
};
builder->create<mlir::linalg::GenericOp>(
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<mlir::linalg::YieldOp>(loc, add);

View File

@@ -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,

View File

@@ -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",