[fir][NFC] Move RewritePatterns.td to CanonicalizationPatterns.td in Dialect
RewritePatterns.td/RewritePatterns.inc is used only by the FIROps.cpp file. This patch move this file logically in the Dialect folder together with FIRDialet, FIROps, FIRTypes ... It also rename it to CanonicalizationPatterns.td. This patch is part of the upstreaming effort from fir-dev branch. Reviewed By: schweitz Differential Revision: https://reviews.llvm.org/D112522
This commit is contained in:
parent
801cf36a23
commit
d43f779f82
|
|
@ -8,6 +8,10 @@ mlir_tablegen(FIROpsTypes.h.inc --gen-typedef-decls)
|
|||
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")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
//===-- RewritePatterns.td - FIR Rewrite Patterns -----------*- tablegen -*-===//
|
||||
//===-- CanonicalizationPatterns.td - FIR Canonicalization Patterns -------===//
|
||||
//
|
||||
// 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 CombineConvertOptPattern
|
|||
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)),
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ add_flang_library(FIRDialect
|
|||
FIRType.cpp
|
||||
|
||||
DEPENDS
|
||||
CanonicalizationPatternsIncGen
|
||||
FIRSupport
|
||||
FIROpsIncGen
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ add_flang_library(FIRTransforms
|
|||
FIRDialect
|
||||
FIRSupport
|
||||
FIROptTransformsPassIncGen
|
||||
RewritePatternsIncGen
|
||||
|
||||
LINK_LIBS
|
||||
FIRDialect
|
||||
|
|
|
|||
Loading…
Reference in New Issue