llvm-project/mlir/lib/Transforms
River Riddle 53b946aa63 [mlir] Refactor the representation of function-like argument/result attributes.
The current design uses a unique entry for each argument/result attribute, with the name of the entry being something like "arg0". This provides for a somewhat sparse design, but ends up being much more expensive (from a runtime perspective) in-practice. The design requires building a string every time we lookup the dictionary for a specific arg/result, and also requires N attribute lookups when collecting all of the arg/result attribute dictionaries.

This revision restructures the design to instead have an ArrayAttr that contains all of the attribute dictionaries for arguments and another for results. This design reduces the number of attribute name lookups to 1, and allows for O(1) lookup for individual element dictionaries. The major downside is that we can end up with larger memory usage, as the ArrayAttr contains an entry for each element even if that element has no attributes. If the memory usage becomes too problematic, we can experiment with a more sparse structure that still provides a lot of the wins in this revision.

This dropped the compilation time of a somewhat large TensorFlow model from ~650 seconds to ~400 seconds.

Differential Revision: https://reviews.llvm.org/D102035
2021-05-07 19:32:31 -07:00
..
Utils [mlir] Refactor the representation of function-like argument/result attributes. 2021-05-07 19:32:31 -07:00
BufferDeallocation.cpp [mlir] Rename BufferAliasAnalysis to BufferViewFlowAnalysis 2021-05-07 16:12:54 +02:00
BufferOptimizations.cpp [mlir] Rename BufferAliasAnalysis to BufferViewFlowAnalysis 2021-05-07 16:12:54 +02:00
BufferResultsToOutParams.cpp [MLIR] Create memref dialect and move dialect-specific ops from std. 2021-03-15 11:14:09 +01:00
BufferUtils.cpp Revert "Revert "[mlir] Introduce CloneOp and adapt test cases in BufferDeallocation."" 2021-03-31 09:49:09 +02:00
Bufferize.cpp [PatternMatch] Big mechanical rename OwningRewritePatternList -> RewritePatternSet and insert -> add. NFC 2021-03-22 17:20:50 -07:00
CMakeLists.txt Revert "Revert "[mlir] Introduce CloneOp and adapt test cases in BufferDeallocation."" 2021-03-31 09:49:09 +02:00
CSE.cpp [mlir][cse] do not replace operands in previously simplified operations 2021-03-31 12:20:34 -07:00
Canonicalizer.cpp Rename FrozenRewritePatternList -> FrozenRewritePatternSet; NFC. 2021-03-22 17:40:45 -07:00
Inliner.cpp [mlir][Inliner] Don't optimize callees in async mode if there is only one to optimize 2021-02-23 18:44:09 -08:00
LocationSnapshot.cpp [mlir] Simplify various pieces of code now that Identifier has access to the Context/Dialect 2021-02-26 18:00:05 -08:00
LoopCoalescing.cpp [mlir] Use mlir::OpState::operator->() to get to methods of mlir::Operation. This is a preparation step to remove the corresponding methods from OpState. 2020-12-09 12:11:32 +01:00
LoopFusion.cpp [mlir] Update dstNode after DenseMap insertion in loop fusion pass. 2021-05-06 15:23:59 -07:00
LoopInvariantCodeMotion.cpp [mlir][BuiltinDialect] Resolve comments from D91571 2020-11-19 11:12:49 -08:00
MemRefDataFlowOpt.cpp [MLIR] Create memref dialect and move dialect-specific ops from std. 2021-03-15 11:14:09 +01:00
NormalizeMemRefs.cpp [MLIR] Create memref dialect and move dialect-specific ops from std. 2021-03-15 11:14:09 +01:00
OpStats.cpp [mlir][BuiltinDialect] Resolve comments from D91571 2020-11-19 11:12:49 -08:00
ParallelLoopCollapsing.cpp [mlir] NFC: Rename LoopOps dialect to SCF (Structured Control Flow) 2020-05-11 15:04:27 +02:00
PassDetail.h [MLIR] Create memref dialect and move dialect-specific ops from std. 2021-03-15 11:14:09 +01:00
PipelineDataTransfer.cpp [MLIR] Create memref dialect and move dialect-specific ops from std. 2021-03-15 11:14:09 +01:00
SCCP.cpp [mlir] Refactor the forward dataflow propagation in SCCP into a generic framework 2021-04-26 19:39:46 -07:00
StripDebugInfo.cpp [mlir][BuiltinDialect] Resolve comments from D91571 2020-11-19 11:12:49 -08:00
SymbolDCE.cpp Define a `NoTerminator` traits that allows operations with a single block region to not provide a terminator 2021-03-25 03:59:03 +00:00
ViewOpGraph.cpp [mlir] Register the print-op-graph pass using ODS 2021-02-20 15:42:02 -08:00
ViewRegionGraph.cpp [mlir][Pass] Update the PassGen to generate base classes instead of utilities 2020-04-07 14:08:52 -07:00