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.
Details
Diff Detail
Event Timeline
Updated, and responses to review comments below...
lib/Analysis/IPA/GlobalsModRef.cpp | ||
---|---|---|
698 | Sorry, I was trying to use GV to do some stuff that ended up with the FIXME comment instead. =] Based on Michael's comment, I'll add in the stub that uses it around the FIXME comment, which should also make it much more clear how to safely implement that FIXME. | |
762 | Yea, that also gives me a much better place to anchor the FIXME above. Should make sure that we don't introduce a bug about the same GV when addressing that FIXME. | |
819 | I really don't like the swap pattern... Does doing this in separate variable initializers make it more clear? (Patch updated to do that...) |
Where is GV used?