[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)
commitbdf5dc7056fa4fabbc5329a7ddb9b85583af616e
treeaf624d41cc65e1a28ac00473ed3bc8997de55649
parente40350d020af663ab1201c8aaef69694697848a8
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244078 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/IPA/GlobalsModRef.cpp
test/Analysis/GlobalsModRef/nonescaping-noalias.ll