From d3a31c4db4e97ce30966f800238a0139134bffa7 Mon Sep 17 00:00:00 2001 From: Jacques Pienaar Date: Mon, 6 Apr 2020 15:55:25 -0700 Subject: [PATCH] Remove case in rewritergen unmatched opdefgen side The rewriter generates a call to build that is not handled by opdef generator and so will fail to compile. Also if this is a root node being replaced (depth 0) then using the more generic build method in the rewrite suffices. --- mlir/tools/mlir-tblgen/RewriterGen.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/mlir/tools/mlir-tblgen/RewriterGen.cpp b/mlir/tools/mlir-tblgen/RewriterGen.cpp index 0cac412..a484316 100644 --- a/mlir/tools/mlir-tblgen/RewriterGen.cpp +++ b/mlir/tools/mlir-tblgen/RewriterGen.cpp @@ -819,17 +819,9 @@ std::string PatternEmitter::handleOpCreation(DagNode tree, int resultIndex, return resultValue; } - // TODO: Remove once broadcastable has been updated. This query here is not - // really about broadcastable or not, it is about which build method to invoke - // and that requires knowledge of whether ODS generated a builder that need - // not take return types. That knowledge should be captured in one place - // rather than duplicated. - bool isResultsBroadcastableShape = - resultOp.getTrait("OpTrait::ResultsBroadcastableShape"); bool usePartialResults = valuePackName != resultValue; - if (isResultsBroadcastableShape || usePartialResults || depth > 0 || - resultIndex < 0) { + if (usePartialResults || depth > 0 || resultIndex < 0) { // For these cases (broadcastable ops, op results used both as auxiliary // values and replacement values, ops in nested patterns, auxiliary ops), we // still need to supply the result types when building the op. But because -- 2.7.4