This is an archive of the discontinued LLVM Phabricator instance.

[GlobalsAA] Don't assume anything about functions that may be overridden
ClosedPublic

Authored by jmolloy on Sep 29 2015, 7:12 AM.

Details

Reviewers
chandlerc
hfinkel
Summary

Weak linkage and friends allow a symbol to be overriden outside the
code generator's model, so GlobalsAA shouldn't assume that anything it
can compute about such a symbol is valid.

This should make GlobalsAA more conservative and fix the last problem seen in the wild.

Chandler, you had concerns about GlobalsAA's conservativeness. Do you think this is sufficient or do you still have worries?

Diff Detail

Repository
rL LLVM

Event Timeline

jmolloy updated this revision to Diff 35966.Sep 29 2015, 7:12 AM
jmolloy retitled this revision from to [GlobalsAA] Don't assume anything about functions that may be overridden.
jmolloy updated this object.
jmolloy added reviewers: chandlerc, hfinkel.
jmolloy set the repository for this revision to rL LLVM.
jmolloy added a subscriber: llvm-commits.
chandlerc accepted this revision.Oct 12 2015, 11:13 AM
chandlerc edited edge metadata.

This is clearly correct. Please feel free to commit.

I want to record that we can probably do much better than this. Specifically, we should model external (or replaceable) functions as mod/ref-ing all external (or captured externally) globals, but not mod/ref-ing any non-externally-captured internal globals. Not sure where the best place is to record that? If you find a good place, add the comment and move on. =]

This revision is now accepted and ready to land.Oct 12 2015, 11:13 AM
jmolloy closed this revision.Oct 26 2015, 3:29 AM