llvm-project/mlir/lib/Rewrite
Chris Lattner 41d4aa7de6 [SymbolRefAttr] Revise SymbolRefAttr to hold a StringAttr.
SymbolRefAttr is fundamentally a base string plus a sequence
of nested references.  Instead of storing the string data as
a copies StringRef, store it as an already-uniqued StringAttr.

This makes a lot of things simpler and more efficient because:
1) references to the symbol are already stored as StringAttr's:
   there is no need to copy the string data into MLIRContext
   multiple times.
2) This allows pointer comparisons instead of string
   comparisons (or redundant uniquing) within SymbolTable.cpp.
3) This allows SymbolTable to hold a DenseMap instead of a
   StringMap (which again copies the string data and slows
   lookup).

This is a moderately invasive patch, so I kept a lot of
compatibility APIs around.  It would be nice to explore changing
getName() to return a StringAttr for example (right now you have
to use getNameAttr()), and eliminate things like the StringRef
version of getSymbol.

Differential Revision: https://reviews.llvm.org/D108899
2021-08-29 21:54:47 -07:00
..
ByteCode.cpp [SymbolRefAttr] Revise SymbolRefAttr to hold a StringAttr. 2021-08-29 21:54:47 -07:00
ByteCode.h [mlir][PDL] Add support for variadic operands and results in the PDL byte code 2021-03-16 13:20:19 -07:00
CMakeLists.txt Rename FrozenRewritePatternList -> FrozenRewritePatternSet; NFC. 2021-03-22 17:40:45 -07:00
FrozenRewritePatternSet.cpp [mlir] Add support for filtering patterns based on debug names and labels 2021-06-02 12:05:25 -07:00
PatternApplicator.cpp [mlir] Debug print pattern before and after matchAndRewrite call 2021-05-08 12:00:36 +03:00