summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-04-24 11:05:20 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-04-24 11:05:20 +0000
commit24553934f804640b64283c85d451d27b9c79c785 (patch)
tree2a4a9920ea564cd8dcbc82a6f67070e60492d409 /compiler-rt
parentd6aa8f435b5d10326d30e6288ea959526ef51128 (diff)
downloadbcm5719-llvm-24553934f804640b64283c85d451d27b9c79c785.tar.gz
bcm5719-llvm-24553934f804640b64283c85d451d27b9c79c785.zip
[LCG] Incorporate the core trick of improvements on the naive Tarjan's
algorithm here: http://dl.acm.org/citation.cfm?id=177301. The idea of isolating the roots has even more relevance when using the stack not just to implement the DFS but also to implement the recursive step. Because we use it for the recursive step, to isolate the roots we need to maintain two stacks: one for our recursive DFS walk, and another of the nodes that have been walked. The nice thing is that the latter will be half the size. It also fixes a complete hack where we scanned backwards over the stack to find the next potential-root to continue processing. Now that is always the top of the DFS stack. While this is a really nice improvement already (IMO) it further opens the door for two important simplifications: 1) De-duplicating some of the code across the two different walks. I've actually made the duplication a bit worse in some senses with this patch because the two are starting to converge. 2) Dramatically simplifying the loop structures of both walks. I wanted to do those separately as they'll be essentially *just* CFG restructuring. This patch on the other hand actually uses different datastructures to implement the algorithm itself. llvm-svn: 207098
Diffstat (limited to 'compiler-rt')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud