This is an archive of the discontinued LLVM Phabricator instance.

CFLAA Bugfix -- Tag untrackable pointers (inttoptr/ptrtoint)
ClosedPublic

Authored by george.burgess.iv on Mar 5 2015, 8:33 PM.

Details

Summary

// Hal already LGTM'ed this for style, I'm putting it here so any discussions about design are published, as requested. :)

This patch notes that pointers passed to inttoptr/ptrtoint can escape.

  • Used StratifiedAttrs instead of one-way edges because StratifiedAttrs don't union everything (the advantage of one-way edges), and we get propagation of the Unknown attribute to sets "below" the Unknown one for free.
  • Explicitly omitted from this patch: special handling of Unknown StratifiedAttrs. An Unknown attribute on some set only forces a MayAlias if the set it's being compared to has any StratifiedAttrs set (interacts with an argument not marked as noalias, a global, or inttoptr/ptrtoint). I can't see how this can be broken, but feedback is appreciated.

Diff Detail

Event Timeline

george.burgess.iv retitled this revision from to CFLAA Bugfix -- Tag untrackable pointers (inttoptr/ptrtoint).
george.burgess.iv updated this object.
george.burgess.iv edited the test plan for this revision. (Show Details)
george.burgess.iv added a subscriber: Unknown Object (MLST).
majnemer added inline comments.
lib/Analysis/CFLAliasAnalysis.cpp
269–274

Please bind pointer tokens to the variable names.

Addressed David's feedback. Thanks for catching that :)

dberlin edited edge metadata.Mar 9 2015, 9:48 AM

LGTM algorithmically

This revision is now accepted and ready to land.Mar 9 2015, 7:44 PM