[Mlir-commits] [mlir] [mlir][python] loosen infertype (PR #73620)

Maksim Levental llvmlistbot at llvm.org
Tue Nov 28 00:18:03 PST 2023


https://github.com/makslevental created https://github.com/llvm/llvm-project/pull/73620

None

>From e7ffb32efe76fc21e61f5122cae9fab819f4a3aa Mon Sep 17 00:00:00 2001
From: max <maksim.levental at gmail.com>
Date: Tue, 28 Nov 2023 02:17:19 -0600
Subject: [PATCH] [mlir][python] loosen infertype

---
 mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp b/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
index 0c0ad2cfeffdcc2..10fda89a54d5257 100644
--- a/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
@@ -21,6 +21,8 @@
 #include "llvm/TableGen/Error.h"
 #include "llvm/TableGen/Record.h"
 
+#include <iostream>
+
 using namespace mlir;
 using namespace mlir::tblgen;
 
@@ -582,8 +584,7 @@ static bool hasFirstAttrDerivedResultTypes(const Operator &op) {
 /// Returns true if the InferTypeOpInterface can be used to infer result types
 /// of the given operation.
 static bool hasInferTypeInterface(const Operator &op) {
-  return op.getTrait("::mlir::InferTypeOpInterface::Trait") &&
-         op.getNumRegions() == 0;
+  return op.getTrait("::mlir::InferTypeOpInterface::Trait");
 }
 
 /// Returns true if there is a trait or interface that can be used to infer



More information about the Mlir-commits mailing list