Integrate llvm-project at d5db25fb1d0863f4f82445f2812bb64793429583 (#8137)
* Reset third_party/llvm-project: d5db25fb1d0863f4f82445f2812bb64793429583 (2022-01-18 18:48:43 -0800): [mlir][textmate] Add support for function visibility
* Delete dialect parse/print hooks that are now auto-generated.
* Remove redundant generated dialect parse/print from iree_input.
* Bump mhlo to pickup changes for https://reviews.llvm.org/D117524.
* Handle auto-generated print/parse attr/type conflicts.
* Disables auto generated for dialects that do meaningful things. Deletes those that are just boilerplate.
* Renames tablegen FLOW_Dialect -> Flow_Dialect since the generated class names are derived from that and need to match.
* Hard fork iree-dialects to integrations/tensorflow.
We should have done this from the beginning and then updated it explicitly on frontend upgrades (which is what out of tree is doing).
Effectively, this directory is an island within the repo and must be isolated. This broke as changes to make it compatible with LLVM head don't work for the frontend version.
* Fix remaining build errors.
* Fix Codegen lit tests.
* Fix more lit tests.
* Fix yapf error.
* Fix last failing lit test.
* Fix failing python lit tests.
* Fix pydm.functional_if printer to print a space before the region start.
(this used to happen implicitly)
Co-authored-by: MaheshRavishankar <ravishankarm@google.com>
diff --git a/llvm-external-projects/iree-dialects/lib/Dialect/Input/InputDialect.cpp b/llvm-external-projects/iree-dialects/lib/Dialect/Input/InputDialect.cpp
index ef6a95a..060d308 100644
--- a/llvm-external-projects/iree-dialects/lib/Dialect/Input/InputDialect.cpp
+++ b/llvm-external-projects/iree-dialects/lib/Dialect/Input/InputDialect.cpp
@@ -29,15 +29,3 @@
#include "iree-dialects/Dialect/Input/InputOps.cpp.inc"
>();
}
-
-Type IREEInputDialect::parseType(DialectAsmParser &parser) const {
- StringRef typeTag;
- Type genType;
- if (succeeded(parser.parseKeyword(&typeTag)))
- generatedTypeParser(parser, typeTag, genType);
- return genType;
-}
-
-void IREEInputDialect::printType(Type type, DialectAsmPrinter &printer) const {
- (void)generatedTypePrinter(type, printer);
-}
diff --git a/llvm-external-projects/iree-dialects/lib/Dialect/PyDM/IR/PyDMDialect.cpp b/llvm-external-projects/iree-dialects/lib/Dialect/PyDM/IR/PyDMDialect.cpp
index 5db10f7..ca77eac 100644
--- a/llvm-external-projects/iree-dialects/lib/Dialect/PyDM/IR/PyDMDialect.cpp
+++ b/llvm-external-projects/iree-dialects/lib/Dialect/PyDM/IR/PyDMDialect.cpp
@@ -67,27 +67,6 @@
llvm_unreachable("unhandled iree_pydm constant materialization");
}
-Type IREEPyDMDialect::parseType(DialectAsmParser &parser) const {
- StringRef typeTag;
- if (succeeded(parser.parseKeyword(&typeTag))) {
- Type genType;
- auto parseResult = generatedTypeParser(parser, typeTag, genType);
- if (parseResult.hasValue()) {
- if (*parseResult) {
- return Type();
- }
- return genType;
- }
- }
-
- parser.emitError(parser.getNameLoc(), "unknown dialect type");
- return Type();
-}
-
-void IREEPyDMDialect::printType(Type type, DialectAsmPrinter &printer) const {
- (void)generatedTypePrinter(type, printer);
-}
-
//------------------------------------------------------------------------------
// Python type implementation
//------------------------------------------------------------------------------
diff --git a/llvm-external-projects/iree-dialects/lib/Dialect/PyDM/IR/PyDMOps.cpp b/llvm-external-projects/iree-dialects/lib/Dialect/PyDM/IR/PyDMOps.cpp
index 3b3e961..926cc98 100644
--- a/llvm-external-projects/iree-dialects/lib/Dialect/PyDM/IR/PyDMOps.cpp
+++ b/llvm-external-projects/iree-dialects/lib/Dialect/PyDM/IR/PyDMOps.cpp
@@ -488,6 +488,7 @@
// Print yield explicitly if the op defines values.
printBlockTerminators = true;
}
+ p << " ";
p.printRegion(op.thenRegion(),
/*printEntryBlockArgs=*/false,
/*printBlockTerminators=*/printBlockTerminators);
@@ -495,7 +496,7 @@
// Print the 'else' regions if it exists and has a block.
auto &elseRegion = op.elseRegion();
if (!elseRegion.empty()) {
- p << " else";
+ p << " else ";
p.printRegion(elseRegion,
/*printEntryBlockArgs=*/false,
/*printBlockTerminators=*/printBlockTerminators);
diff --git a/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/iree_pydm/rtl/modules/macros.py b/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/iree_pydm/rtl/modules/macros.py
index 5973070..8f72616 100644
--- a/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/iree_pydm/rtl/modules/macros.py
+++ b/llvm-external-projects/iree-dialects/python/iree/compiler/dialects/iree_pydm/rtl/modules/macros.py
@@ -45,7 +45,6 @@
def unbox_i32(stage: ImportStage, value: ir.Value) -> ir.Value:
return _unbox_i32(stage, value)
-
def _unbox_i64(stage: ImportStage, value: ir.Value) -> ir.Value:
i64_type = d.IntegerType.get_explicit(64)
if d.ObjectType.isinstance(value.type):
diff --git a/llvm-external-projects/iree-dialects/test/python/iree_pydm/importer/booleans.py b/llvm-external-projects/iree-dialects/test/python/iree_pydm/importer/booleans.py
index 1c856fa..9d86f37 100644
--- a/llvm-external-projects/iree-dialects/test/python/iree_pydm/importer/booleans.py
+++ b/llvm-external-projects/iree-dialects/test/python/iree_pydm/importer/booleans.py
@@ -7,7 +7,7 @@
# CHECK-LABEL: @logical_and
# CHECK: %[[XVAL:.*]] = load_var %x
# CHECK: %[[XBOOL:.*]] = as_bool %[[XVAL]]
-# CHECK: %[[R1:.*]] = functional_if %[[XBOOL]] {{.*}} {
+# CHECK: %[[R1:.*]] = functional_if %[[XBOOL]] {{.*}}{
# CHECK: %[[YVAL:.*]] = load_var %y
# CHECK: %[[YBOOL:.*]] = as_bool %[[YVAL]]
# CHECK: %[[R2:.*]] = functional_if %[[YBOOL]] {{.*}} {
@@ -31,7 +31,7 @@
# # CHECK-LABEL: @logical_or
# CHECK: %[[XVAL:.*]] = load_var %x
# CHECK: %[[XBOOL:.*]] = as_bool %[[XVAL]]
-# CHECK: %[[R1:.*]] = functional_if %[[XBOOL]] {{.*}} {
+# CHECK: %[[R1:.*]] = functional_if %[[XBOOL]] {{.*}}{
# CHECK: yield %[[XVAL]]
# CHECK: } else {
# CHECK: %[[YVAL:.*]] = load_var %y
@@ -67,7 +67,7 @@
# CHECK-LABEL: func @conditional
# CHECK: %[[XVAL:.*]] = load_var %x
# CHECK: %[[XBOOL:.*]] = as_bool %[[XVAL]]
-# CHECK: %[[R1:.*]] = functional_if %[[XBOOL]] {{.*}} {
+# CHECK: %[[R1:.*]] = functional_if %[[XBOOL]] {{.*}}{
# CHECK: %[[TWOVAL:.*]] = constant 2
# CHECK: %[[TWOBOXED:.*]] = box %[[TWOVAL]] : !iree_pydm.integer ->
# CHECK: yield %[[TWOBOXED]]
diff --git a/llvm-external-projects/iree-dialects/test/python/iree_pydm/importer/comparison.py b/llvm-external-projects/iree-dialects/test/python/iree_pydm/importer/comparison.py
index 1a0efc7..2ba7048 100644
--- a/llvm-external-projects/iree-dialects/test/python/iree_pydm/importer/comparison.py
+++ b/llvm-external-projects/iree-dialects/test/python/iree_pydm/importer/comparison.py
@@ -115,7 +115,7 @@
# CHECK-DAG: %[[Y:.*]] = load_var %y
# CHECK: %[[XP:.*]], %[[YP:.*]] = dynamic_binary_promote %[[X]], %[[Y]]
# CHECK: %[[R1:.*]] = apply_compare "lt", %[[XP]], %[[YP]]
-# CHECK: %[[RESULT:.*]] = functional_if %[[R1]] {{.*}} {
+# CHECK: %[[RESULT:.*]] = functional_if %[[R1]] {{.*}}{
# CHECK: %[[Z:.*]] = load_var %z
# NOTE: Promotion happens on original loaded values, not already promoted
# values.
@@ -144,7 +144,7 @@
# CHECK-LABEL: nested_short_circuit_expression
# Verify that the nested expression is evaluated in the context of the if.
-# CHECK: functional_if {{.*}} {
+# CHECK: functional_if {{.*}}{
# CHECK: apply_binary "add"
# CHECK: } else {
@test_import_global