summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-11-28 18:49:59 +0000
committerJustin Lebar <jlebar@google.com>2016-11-28 18:49:59 +0000
commit62c20d8b3b6f7fd006fc0c6eb1f14c2681a2bb31 (patch)
treedbcb69135b86af711ee5182fc334db961082d1f4 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent2228f70a85b4635f51f2b62cea5a2c658ff3be2e (diff)
downloadbcm5719-llvm-62c20d8b3b6f7fd006fc0c6eb1f14c2681a2bb31.tar.gz
bcm5719-llvm-62c20d8b3b6f7fd006fc0c6eb1f14c2681a2bb31.zip
[StructurizeCFG] Refactor NearestCommonDominator.
Summary: As far as I can tell, doing our own computations in NearestCommonDominator is a false optimization -- DomTree will build up what appears to be exactly this data when it decides it's worthwhile. Moreover, by building the cache ourselves, we cannot take advantage of the cache that the domtree might have available. In addition, I am not convinced of the correctness of the original code. In particular, setting ResultIndex = 1 on the first addBlock instead of setting it to 0 is quite fishy. Similarly, it's not clear to me that setting IndexMap[Node] = 0 for every node as we walk up the tree finding a common parent is correct. But rather than ponder over these questions, I'd rather just make the code do the obviously-correct thing. This patch also changes the NearestCommonDominator API a bit, improving the names and getting rid of the boolean parameter in addBlock -- see http://jlebar.com/2011/12/16/Boolean_parameters_to_API_functions_considered_harmful..html Reviewers: arsenm Subscribers: aemerson, wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D26998 llvm-svn: 288050
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud