This is an archive of the discontinued LLVM Phabricator instance.

[CFLAA] Make CFLAnders more conservative when it sees newly created values
ClosedPublic

Authored by grievejia on Aug 2 2016, 12:16 PM.

Details

Summary

There was a patch https://reviews.llvm.org/D22981 that deals with how CFLAnders interacts with values it hasn't seen before. In that patch the workaround is to let getAttrs() return AttrUnknown when newly created values are queried on.

However, the aforementioned workaround fails to work for queries of the form mayAlias(L, N), where L is marked AttrNone and N is created after CFLAnders has executed. The sound was to handle the situation is to let the may-alias query return true (since N may be of the form "bitcast L to ...", "gep L, ...", etc.), but our current implementation will always return false because AttrNone values never may-alias AttrUnknown values.

This patch separate the new-value checks and attribute checks, so that soundness issues mentioned in the previous paragraph will not happen.

Diff Detail

Repository
rL LLVM

Event Timeline

grievejia updated this revision to Diff 66517.Aug 2 2016, 12:16 PM
grievejia retitled this revision from to [CFLAA] Make CFLAnders more conservative when it sees newly created values.
grievejia updated this object.
grievejia added a subscriber: llvm-commits.
george.burgess.iv accepted this revision.Aug 2 2016, 2:45 PM
george.burgess.iv edited edge metadata.

LGTM, thanks for the patch!

This revision is now accepted and ready to land.Aug 2 2016, 2:45 PM
This revision was automatically updated to reflect the committed changes.