[GMR] Teach the conservative path of GMR to catch even more easy cases.
authorChandler Carruth <chandlerc@gmail.com>
Wed, 5 Aug 2015 17:58:30 +0000 (17:58 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 5 Aug 2015 17:58:30 +0000 (17:58 +0000)
commit405e4f90519fb6c11246ed2698b6049682601227
treee2b326dd1dd2c3f353ea775e3ce410afac532979
parent92e6412f2901c42599af8f91702f78a1701d70fb
[GMR] Teach the conservative path of GMR to catch even more easy cases.

In PR24288 it was pointed out that the easy case of a non-escaping
global and something that *obviously* required an escape sometimes is
hidden behind PHIs (or selects in theory). Because we have this binary
test, we can easily just check that all possible input values satisfy
the requirement. This is done with a (very small) recursion through PHIs
and selects. With this, the specific example from the PR is correctly
folded by GVN.

Differential Revision: http://reviews.llvm.org/D11707

llvm-svn: 244078
llvm/lib/Analysis/IPA/GlobalsModRef.cpp
llvm/test/Analysis/GlobalsModRef/nonescaping-noalias.ll