Reapply r221924: "[GVN] Perform Scalar PRE on gep indices that feed loads before
authorChad Rosier <mcrosier@codeaurora.org>
Fri, 14 Nov 2014 21:09:13 +0000 (21:09 +0000)
committerChad Rosier <mcrosier@codeaurora.org>
Fri, 14 Nov 2014 21:09:13 +0000 (21:09 +0000)
commit1ff4c0bf0ba21869e4f7a43843fac11b1244ecf2
treeb88bf82d81ab367e8d16a8aae446b5efc8dd66b0
parent1876784bb1020c493a28158ce01cd4caf771c823
Reapply r221924: "[GVN] Perform Scalar PRE on gep indices that feed loads before
doing Load PRE"

This commit updates the failing test in
Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-mismatch.ll

The failing test is sensitive to the order in which we process loads.  This
version turns on the RPO traversal instead of the while DT traversal in GVN.
The new test code is functionally same just the order of loads that are
eliminated is swapped.

This new version also fixes an issue where GVN splits a critical edge and
potentially invalidate the RPO/DT iterator.

llvm-svn: 222039
llvm/lib/Transforms/Scalar/GVN.cpp
llvm/test/Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-mismatch.ll
llvm/test/Transforms/GVN/pre-gep-load.ll [new file with mode: 0644]