This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Deduce memory location function attributes
AbandonedPublic

Authored by jdoerfert on Apr 1 2019, 10:46 AM.

Details

Summary

Deduce the memory location attributes, i.a., "inaccessiblememonly",
"argmemonly", and "inaccessible_or_argmemonly", for functions. This
also improves earlier memory behavior deductions, for example D59980, as
we can now identify and ignore accesses to local and constant memory.

Impact on the statistics (-stats) for LLVM-TS + Spec2006,

CHANGED: attributor                   NumAttributesManifested                87205 ->      88546 (    +1.538%)
CHANGED: attributor                   NumAttributesValidFixpoint            118598 ->     119936 (    +1.128%)
  ADDED: attributor                   NumFnArgMemOnly                          n/a ->       5115
CHANGED: attributor                   NumFnReadNone                           2930 ->       3086 (    +5.324%)
CHANGED: attributor                   NumFnReadOnly                           4380 ->       4243 (    -3.128%)
CHANGED: attributor                   NumFnWriteOnly                          1960 ->       1987 (    +1.378%)
CHANGED: functionattrs                NumReadNone                              165 ->         12 (   -92.727%)
CHANGED: functionattrs                NumReadOnly                              134 ->        120 (   -10.448%)
CHANGED: functionattrs                NumWriteOnly                              52 ->         25 (   -51.923%)
CHANGED: memdep                       NumCacheNonLocalPtr                  7731531 ->    7837481 (    +1.370%)

Note: Some ofthe remaining readnone/readonly/writeonly functionattrs

deductions are a result of a bug, see: http://llvm.org/PR41328