NFC: Refactoring PatternSymbolResolver into SymbolInfoMap
authorLei Zhang <antiagainst@google.com>
Sat, 10 Aug 2019 02:03:58 +0000 (19:03 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Sat, 10 Aug 2019 02:04:23 +0000 (19:04 -0700)
commitac68637ba94d05f413b1b963950c300fb2f81a99
treefa09796c3af34c3b170cf2ee087878a0ead7c871
parent41968fb4753118afe5a9f4fecf184fac90d96fe6
NFC: Refactoring PatternSymbolResolver into SymbolInfoMap

In declarative rewrite rules, a symbol can be bound to op arguments or
results in the source pattern, and it can be bound to op results in the
result pattern. This means given a symbol in the pattern, it can stands
for different things: op operand, op attribute, single op result,
op result pack. We need a better way to model this complexity so that
we can handle according to the specific kind a symbol corresponds to.

Created SymbolInfo class for maintaining the information regarding a
symbol. Also created a companion SymbolInfoMap class for a map of
such symbols, providing insertion and querying depending on use cases.

PiperOrigin-RevId: 262675515
mlir/include/mlir/TableGen/Pattern.h
mlir/lib/TableGen/Pattern.cpp
mlir/tools/mlir-tblgen/RewriterGen.cpp