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)
commit1523db7c64186226317a9e5baecfbde8eb04c580
tree0bd66f062b03f6884d56074e0cd5c970cc01e49b
parent6536b834f864aed3abb866718457602e4f4336cb
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222039 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/GVN.cpp
test/Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-mismatch.ll
test/Transforms/GVN/pre-gep-load.ll [new file with mode: 0644]