[PATCH] D112522: [fir][NFC] Move RewritePatterns.td in Dialect
Valentin Clement via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 26 11:51:12 PDT 2021
clementval updated this revision to Diff 382416.
clementval added a comment.
Rename file
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112522/new/
https://reviews.llvm.org/D112522
Files:
flang/include/flang/Optimizer/Dialect/CMakeLists.txt
flang/include/flang/Optimizer/Dialect/CanonicalizationPatterns.td
flang/include/flang/Optimizer/Transforms/CMakeLists.txt
flang/include/flang/Optimizer/Transforms/RewritePatterns.td
flang/lib/Optimizer/Dialect/CMakeLists.txt
flang/lib/Optimizer/Dialect/FIROps.cpp
flang/lib/Optimizer/Transforms/CMakeLists.txt
Index: flang/lib/Optimizer/Transforms/CMakeLists.txt
===================================================================
--- flang/lib/Optimizer/Transforms/CMakeLists.txt
+++ flang/lib/Optimizer/Transforms/CMakeLists.txt
@@ -11,7 +11,6 @@
FIRDialect
FIRSupport
FIROptTransformsPassIncGen
- RewritePatternsIncGen
LINK_LIBS
FIRDialect
Index: flang/lib/Optimizer/Dialect/FIROps.cpp
===================================================================
--- flang/lib/Optimizer/Dialect/FIROps.cpp
+++ flang/lib/Optimizer/Dialect/FIROps.cpp
@@ -25,7 +25,7 @@
#include "llvm/ADT/TypeSwitch.h"
namespace {
-#include "flang/Optimizer/Transforms/RewritePatterns.inc"
+#include "flang/Optimizer/Dialect/CanonicalizationPatterns.inc"
} // namespace
using namespace fir;
Index: flang/lib/Optimizer/Dialect/CMakeLists.txt
===================================================================
--- flang/lib/Optimizer/Dialect/CMakeLists.txt
+++ flang/lib/Optimizer/Dialect/CMakeLists.txt
@@ -5,6 +5,7 @@
FIRType.cpp
DEPENDS
+ CanonicalizationPatternsIncGen
FIRSupport
FIROpsIncGen
Index: flang/include/flang/Optimizer/Transforms/CMakeLists.txt
===================================================================
--- flang/include/flang/Optimizer/Transforms/CMakeLists.txt
+++ flang/include/flang/Optimizer/Transforms/CMakeLists.txt
@@ -1,8 +1,3 @@
-
-set(LLVM_TARGET_DEFINITIONS RewritePatterns.td)
-mlir_tablegen(RewritePatterns.inc -gen-rewriters)
-add_public_tablegen_target(RewritePatternsIncGen)
-
set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls -name OptTransform)
add_public_tablegen_target(FIROptTransformsPassIncGen)
Index: flang/include/flang/Optimizer/Dialect/CanonicalizationPatterns.td
===================================================================
--- flang/include/flang/Optimizer/Dialect/CanonicalizationPatterns.td
+++ flang/include/flang/Optimizer/Dialect/CanonicalizationPatterns.td
@@ -1,4 +1,4 @@
-//===-- RewritePatterns.td - FIR Rewrite Patterns -----------*- tablegen -*-===//
+//===-- RewritePatterns.td - FIR Rewrite Patterns ----------*- tablegen -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -49,7 +49,8 @@
def createConstantOp
: NativeCodeCall<"$_builder.create<mlir::arith::ConstantOp>"
"($_loc, $_builder.getIndexType(), "
- "rewriter.getIndexAttr($1.dyn_cast<IntegerAttr>().getInt()))">;
+ "rewriter.getIndexAttr($1.dyn_cast<IntegerAttr>()"
+ ".getInt()))">;
def ForwardConstantConvertPattern
: Pat<(fir_ConvertOp:$res (Arith_ConstantOp:$cnt $attr)),
Index: flang/include/flang/Optimizer/Dialect/CMakeLists.txt
===================================================================
--- flang/include/flang/Optimizer/Dialect/CMakeLists.txt
+++ flang/include/flang/Optimizer/Dialect/CMakeLists.txt
@@ -8,6 +8,10 @@
mlir_tablegen(FIROpsTypes.cpp.inc --gen-typedef-defs)
add_public_tablegen_target(FIROpsIncGen)
+set(LLVM_TARGET_DEFINITIONS CanonicalizationPatterns.td)
+mlir_tablegen(CanonicalizationPatterns.inc -gen-rewriters)
+add_public_tablegen_target(CanonicalizationPatternsIncGen)
+
add_custom_target(flang-doc)
set(dialect_doc_filename "FIRLangRef")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112522.382416.patch
Type: text/x-patch
Size: 3368 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211026/334964e2/attachment.bin>
More information about the llvm-commits
mailing list