summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-01-02 07:03:00 +0000
committerCameron Zwarich <zwarich@apple.com>2011-01-02 07:03:00 +0000
commita0800337c99a173b7760fb50e97037babc956376 (patch)
tree1d4877781b2f347558ab3ac5a9a139c9791f7294 /llvm/lib/Transforms/Scalar/LoopRotation.cpp
parent47731fe3f110b9128118e6ec2edf9e6201b6fc07 (diff)
downloadbcm5719-llvm-a0800337c99a173b7760fb50e97037babc956376.tar.gz
bcm5719-llvm-a0800337c99a173b7760fb50e97037babc956376.zip
Speed up dominator computation some more by optimizing bucket processing. When
naively implemented, the Lengauer-Tarjan algorithm requires a separate bucket for each vertex. However, this is unnecessary, because each vertex is only placed into a single bucket (that of its semidominator), and each vertex's bucket is processed before it is added to any bucket itself. Instead of using a bucket per vertex, we use a single array Buckets that has two purposes. Before the vertex V with DFS number i is processed, Buckets[i] stores the index of the first element in V's bucket. After V's bucket is processed, Buckets[i] stores the index of the next element in the bucket to which V now belongs, if any. Reading from the buckets can also be optimized. Instead of processing the bucket of V's parent at the end of processing V, we process the bucket of V itself at the beginning of processing V. This means that the case of the root vertex can be simplified somewhat. It also means that we don't need to look up the DFS number of the semidominator of every node in the bucket we are processing, since we know it is the current index being processed. This is a 6.5% speedup running -domtree on test-suite + SPEC2000/2006, with larger speedups of around 12% on the larger benchmarks like GCC. llvm-svn: 122680
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopRotation.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud