提交 c5eae817 编写于 作者: B Benjamin Kramer 提交者: TensorFlower Gardener

Integrate LLVM up to https://github.com/llvm/llvm-project/commit/129cf84e6953

PiperOrigin-RevId: 306623856
Change-Id: I8a5a1ef0cb6152e72397dd8a93841da01b10534c
上级 6ee1ea88
......@@ -40,7 +40,6 @@ limitations under the License.
#include "mlir/IR/Value.h" // from @llvm-project
#include "mlir/Support/LLVM.h" // from @llvm-project
#include "mlir/Support/LogicalResult.h" // from @llvm-project
#include "mlir/Support/STLExtras.h" // from @llvm-project
#include "mlir/Transforms/InliningUtils.h" // from @llvm-project
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h"
#include "tensorflow/core/platform/logging.h"
......@@ -90,7 +89,7 @@ struct TFInlinerInterface : public DialectInlinerInterface {
// are perfectly forwarded to the block's terminator.
bool BlockWrapsSingleOp(Block* block) {
auto body = block->without_terminator();
if (!has_single_element(body)) return false;
if (!hasSingleElement(body)) return false;
Operation& wrapped_op = *body.begin();
Operation* terminator = block->getTerminator();
......
......@@ -41,7 +41,6 @@ limitations under the License.
#include "mlir/IR/Types.h" // from @llvm-project
#include "mlir/IR/Value.h" // from @llvm-project
#include "mlir/Support/LogicalResult.h" // from @llvm-project
#include "mlir/Support/STLExtras.h" // from @llvm-project
#include "mlir/Transforms/FoldUtils.h" // from @llvm-project
#include "mlir/Transforms/InliningUtils.h" // from @llvm-project
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_types.h"
......@@ -318,7 +317,7 @@ YieldOp IslandOp::GetYield() { return llvm::cast<YieldOp>(GetBody().back()); }
// operation results are perfectly forwarded to the islands yield.
bool IslandOp::WrapsSingleOp() {
auto body = GetBody().without_terminator();
if (!has_single_element(body)) return false;
if (!hasSingleElement(body)) return false;
Operation &wrapped_op = *body.begin();
YieldOp yield = GetYield();
......
......@@ -55,7 +55,6 @@ limitations under the License.
#include "mlir/Parser.h" // from @llvm-project
#include "mlir/Support/LLVM.h" // from @llvm-project
#include "mlir/Support/LogicalResult.h" // from @llvm-project
#include "mlir/Support/STLExtras.h" // from @llvm-project
#include "mlir/Transforms/InliningUtils.h" // from @llvm-project
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_structs.h"
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_types.h"
......
......@@ -237,7 +237,7 @@ LogicalResult CreateIslandsFromParallelExecute(
// individual islands per region of parallel_execute.
void LowerSingleIslandParallelExecuteToIslands(
tf_executor::IslandOp island_op) {
if (!has_single_element(island_op.GetBody().without_terminator())) return;
if (!hasSingleElement(island_op.GetBody().without_terminator())) return;
if (auto parallel_execute_op = llvm::dyn_cast<tf_device::ParallelExecuteOp>(
&island_op.GetBody().front()))
......
......@@ -256,7 +256,7 @@ void PromoteResourcesToArgsPass::runOnOperation() {
// This routine should only be called when control flow operations are still
// represented with TF IfOp and WhileOp operations. In this case, there should
// be only one basic blocks in the MLIR representation.
if (!has_single_element(main_func.getBlocks())) {
if (!hasSingleElement(main_func.getBlocks())) {
main_func.emitError() << "expects 'main' function to have 1 block, got "
<< main_func.getBlocks().size();
return signalPassFailure();
......
......@@ -211,7 +211,7 @@ LogicalResult CreateIslandsFromReplicate(const Dialect* tf_dialect,
// islands per replica of the replicate.
LogicalResult LowerSingleIslandReplicateToIslands(
const Dialect* tf_dialect, tf_executor::IslandOp island_op) {
if (!has_single_element(island_op.GetBody().without_terminator()))
if (!hasSingleElement(island_op.GetBody().without_terminator()))
return success();
if (auto replicate_op =
......
......@@ -1112,7 +1112,7 @@ LogicalResult ResourceLiftingForFunctionalControlFlow(FuncOp function) {
// This routine should only be called when control flow operations are still
// represented with TF IfOp and WhileOp operations. In this case, there should
// be only one basic blocks in the MLIR representation.
if (!has_single_element(function.getBlocks())) {
if (!hasSingleElement(function.getBlocks())) {
return function.emitError()
<< "expect the function to have 1 block while it has "
<< function.getBlocks().size();
......
......@@ -32,7 +32,6 @@ limitations under the License.
#include "mlir/Pass/Pass.h" // from @llvm-project
#include "mlir/Pass/PassRegistry.h" // from @llvm-project
#include "mlir/Support/LLVM.h" // from @llvm-project
#include "mlir/Support/STLExtras.h" // from @llvm-project
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_device.h"
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h"
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_types.h"
......
......@@ -38,7 +38,6 @@ limitations under the License.
#include "mlir/IR/Value.h" // from @llvm-project
#include "mlir/Pass/Pass.h" // from @llvm-project
#include "mlir/Pass/PassRegistry.h" // from @llvm-project
#include "mlir/Support/STLExtras.h" // from @llvm-project
#include "mlir/Transforms/RegionUtils.h" // from @llvm-project
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_device.h"
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_executor.h"
......
......@@ -26,7 +26,6 @@ limitations under the License.
#include "mlir/IR/Value.h" // from @llvm-project
#include "mlir/Pass/Pass.h" // from @llvm-project
#include "mlir/Pass/PassRegistry.h" // from @llvm-project
#include "mlir/Support/STLExtras.h" // from @llvm-project
#include "tensorflow/compiler/mlir/tensorflow/analysis/side_effect_analysis.h"
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_executor.h"
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h"
......@@ -220,7 +219,7 @@ void BreakUpIslands::BreakUpIsland(
}
// Skip islands that are already only a single op.
if (has_single_element(island_body)) return;
if (hasSingleElement(island_body)) return;
auto control_type = tf_executor::ControlType::get(&getContext());
auto island_control_inputs = llvm::to_vector<4>(island_op.controlInputs());
......
......@@ -143,7 +143,7 @@ Status HasSingleGraphSingleOpIslandsFunctions(mlir::ModuleOp module) {
return mlir::WalkResult::interrupt();
}
if (!has_single_element(block)) {
if (!hasSingleElement(block)) {
status = errors::FailedPrecondition(
kInvalidExecutorGraphMsg,
"function does not only contain a single tf_executor.graph.");
......
......@@ -1885,13 +1885,13 @@ StatusOr<mlir::OwningModuleRef> GraphDefImporter::Convert(
auto node_name = [&](const OutputTensor& tensor) {
ss << tensor.node->name();
};
mlir::interleave(arg_nodes, ss, node_name, ",");
llvm::interleave(arg_nodes, ss, node_name, ",");
auto inputs = b.getNamedAttr("inputs", b.getStringAttr(ss.str()));
s.clear();
mlir::interleave(ret_nodes, ss, node_name, ",");
llvm::interleave(ret_nodes, ss, node_name, ",");
auto outputs = b.getNamedAttr("outputs", b.getStringAttr(ss.str()));
s.clear();
mlir::interleave(specs.control_outputs, ss, ",");
llvm::interleave(specs.control_outputs, ss, ",");
auto control_outputs =
b.getNamedAttr("control_outputs", b.getStringAttr(ss.str()));
......@@ -1916,16 +1916,16 @@ StatusOr<mlir::OwningModuleRef> GraphDefImporter::Convert(
mlir::Builder b(context);
std::string s;
llvm::raw_string_ostream ss(s);
mlir::interleave(
llvm::interleave(
specs.inputs, ss,
[&](const std::pair<std::string, ArrayInfo>& v) { ss << v.first; },
",");
auto inputs = b.getNamedAttr("inputs", b.getStringAttr(ss.str()));
s.clear();
mlir::interleave(specs.outputs, ss, ",");
llvm::interleave(specs.outputs, ss, ",");
auto outputs = b.getNamedAttr("outputs", b.getStringAttr(ss.str()));
s.clear();
mlir::interleave(specs.control_outputs, ss, ",");
llvm::interleave(specs.control_outputs, ss, ",");
auto control_outputs =
b.getNamedAttr("control_outputs", b.getStringAttr(ss.str()));
......
......@@ -15,6 +15,7 @@ limitations under the License.
#include <sstream>
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
......@@ -26,13 +27,12 @@ limitations under the License.
#include "llvm/TableGen/Main.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
#include "mlir/Support/STLExtras.h" // from @llvm-project
#include "mlir/TableGen/Operator.h" // from @llvm-project
using llvm::interleaveComma;
using llvm::raw_ostream;
using llvm::RecordKeeper;
using llvm::StringRef;
using mlir::interleaveComma;
using mlir::tblgen::Attribute;
using mlir::tblgen::NamedAttribute;
using mlir::tblgen::NamedTypeConstraint;
......
......@@ -658,8 +658,8 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
)
# Check out LLVM and MLIR from llvm-project.
LLVM_COMMIT = "37ac1c19bed7b7d22e9312dfa61e7a4506ed4e49"
LLVM_SHA256 = "b694cd7ed85cbc938f11534d56a326126015de21a5fec3c073dc6125bec1fc24"
LLVM_COMMIT = "129cf84e69537ae5c184550f94be18da738d9261"
LLVM_SHA256 = "4b56ff735e973ee982c4f24ab5b22d56ad0734f2d12d9c57fe1c21530a5840a0"
LLVM_URLS = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
"https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
......
......@@ -728,7 +728,6 @@ cc_library(
],
),
hdrs = glob([
"include/mlir/ADT/*.h",
"include/mlir/Support/*.h",
]),
includes = ["include"],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册