[PATCH] D60076: [Attributor] Deduce memory behavior function attributes

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 1 10:50:26 PDT 2019


jdoerfert created this revision.
jdoerfert added reviewers: homerdin, hfinkel, fedor.sergeev, sanjoy, spatel, nlopes, nicholas, reames.
Herald added projects: clang, LLVM.
Herald added a subscriber: cfe-commits.
jdoerfert added a parent revision: D59980: [Attributor] Deduce memory behavior argument attributes.
jdoerfert added a child revision: D60077: [Attributor] Deduce memory location function attributes.

Deduce the memory behavior, aka "read-none", "read-only", or
"write-only", for functions. This also improves argument deduction
(D59980 <https://reviews.llvm.org/D59980>) because it can rely on the function memory behavior which
is derived.

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

  CHANGED: attributor                   NumAttributesManifested                77683 ->      87205 (   +12.258%)
  CHANGED: attributor                   NumAttributesValidFixpoint            109073 ->     118598 (    +8.733%)
  CHANGED: attributor                   NumFnArgumentReadOnly                  16532 ->      16755 (    +1.349%)
    ADDED: attributor                   NumFnReadNone                            n/a ->       2930
    ADDED: attributor                   NumFnReadOnly                            n/a ->       4380
    ADDED: attributor                   NumFnWriteOnly                           n/a ->       1960
  CHANGED: functionattrs                NumReadNone                             3095 ->        165 (   -94.669%)
  CHANGED: functionattrs                NumReadNoneArg                           216 ->        144 (   -33.333%)
  CHANGED: functionattrs                NumReadOnly                             4363 ->        134 (   -96.929%)
  CHANGED: functionattrs                NumReadOnlyArg                          1072 ->        945 (   -11.847%)
  CHANGED: functionattrs                NumWriteOnly                            2012 ->         52 (   -97.416%)

Note: The deduction will improve with later patches that introduce new

  functionality we can utilize. Also, some are a result of a bug, see:
  http://llvm.org/PR41328


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60076

Files:
  clang/test/CodeGenOpenCL/as_type.cl
  llvm/include/llvm/Transforms/IPO/Attributor.h
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/test/Transforms/FunctionAttrs/arg_returned.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60076.193126.patch
Type: text/x-patch
Size: 20675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190401/d1207754/attachment-0001.bin>


More information about the cfe-commits mailing list