aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorChris Lattner <clattner@nondot.org>2021-05-30 18:02:51 -0700
committerChris Lattner <clattner@nondot.org>2021-06-01 14:46:37 -0700
commit412ae15de49a227de25a695735451f8908ebf999 (patch)
treee5949081b7bb4c5fed5b781e7c06c0f92ef5d844 /clang/lib/Frontend/CompilerInvocation.cpp
parentc1a59fa550818c6d3c229b43918b5045d7df83e6 (diff)
downloadllvm-412ae15de49a227de25a695735451f8908ebf999.zip
llvm-412ae15de49a227de25a695735451f8908ebf999.tar.gz
llvm-412ae15de49a227de25a695735451f8908ebf999.tar.bz2
[Dominators] Rewrite the dominator implementation for efficiency. NFC.
The previous impl densely scanned the entire region starting with an op when dominators were created, creating a DominatorTree for every region. This is extremely expensive up front -- particularly for clients like Linalg/Transforms/Fusion.cpp that construct DominanceInfo for a single query. It is also extremely memory wasteful for IRs that use single block regions commonly (e.g. affine.for) because it's making a dominator tree for a region that has trivial dominance. The implementation also had numerous unnecessary minor efficiencies, e.g. doing multiple walks of the region tree or tryGetBlocksInSameRegion building a DenseMap that it didn't need. This patch switches to an approach where [Post]DominanceInfo is free to construct, and which lazily constructs DominatorTree's for any multiblock regions that it needs. This avoids the up-front cost entirely, making its runtime proportional to the complexity of the region tree instead of # ops in a region. This also avoids the memory and time cost of creating DominatorTree's for single block regions. Finally this rewrites the implementation for simplicity and to avoids the constant factor problems the old implementation had. Differential Revision: https://reviews.llvm.org/D103384
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions