[all-commits] [llvm/llvm-project] 5b12cf: [Attributor][FIX] Traverse uses even if a value is...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Sat Jul 10 13:55:47 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5b12cf3e659bb7e1a975b3b866b933c0c2acff10
      https://github.com/llvm/llvm-project/commit/5b12cf3e659bb7e1a975b3b866b933c0c2acff10
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2021-07-10 (Sat, 10 Jul 2021)

  Changed paths:
    M llvm/lib/Transforms/IPO/Attributor.cpp
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    M llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll
    M llvm/test/Transforms/Attributor/align.ll
    M llvm/test/Transforms/Attributor/depgraph.ll
    M llvm/test/Transforms/Attributor/internal-noalias.ll
    M llvm/test/Transforms/Attributor/internalize.ll
    M llvm/test/Transforms/Attributor/liveness.ll
    M llvm/test/Transforms/Attributor/memory_locations.ll
    M llvm/test/Transforms/Attributor/nodelete.ll
    M llvm/test/Transforms/Attributor/nonnull.ll
    M llvm/test/Transforms/Attributor/norecurse.ll
    M llvm/test/Transforms/Attributor/noundef.ll
    M llvm/test/Transforms/Attributor/potential.ll
    M llvm/test/Transforms/Attributor/range.ll
    M llvm/test/Transforms/Attributor/value-simplify.ll

  Log Message:
  -----------
  [Attributor][FIX] Traverse uses even if a value is assumed constant

Not all attributes are able to handle the interprocedural step and
follow the uses into a call site. Let them be able to combine call site
uses instead. This might result in some unused values/arguments being
leftover but it removes problems where we misused "is dead" even though
it was actually "is simplified/replaced".

We explicitly check for dead values due to constant propagation in
`AAIsDeadValueImpl::areAllUsesAssumedDead` instead.

Differential Revision: https://reviews.llvm.org/D103858


  Commit: 0aab13aaf942a1e4fbf21338fa2223dc292bbc46
      https://github.com/llvm/llvm-project/commit/0aab13aaf942a1e4fbf21338fa2223dc292bbc46
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2021-07-10 (Sat, 10 Jul 2021)

  Changed paths:
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    M llvm/test/Transforms/Attributor/nocapture-1.ll

  Log Message:
  -----------
  [Attributor] Introduce an optimistic getUnderlyingObjects helper

As the `llvm::getUnderlyingObjects` helper, the optimistic version
collects objects that might be the base of a given pointer. In contrast
to the llvm variant, the optimistic one will use assumed information,
e.g., about select conditions or dead blocks, to provide a more precise
result.

Differential Revision: https://reviews.llvm.org/D103859


  Commit: 5ef18e2421835251eb5176bf2e711516b1f4c670
      https://github.com/llvm/llvm-project/commit/5ef18e2421835251eb5176bf2e711516b1f4c670
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2021-07-10 (Sat, 10 Jul 2021)

  Changed paths:
    M llvm/include/llvm/Transforms/IPO/Attributor.h
    M llvm/lib/Transforms/IPO/Attributor.cpp
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    M llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/profile.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll
    M llvm/test/Transforms/Attributor/align.ll
    M llvm/test/Transforms/Attributor/cb_liveness_disabled.ll
    M llvm/test/Transforms/Attributor/cb_liveness_enabled.ll
    M llvm/test/Transforms/Attributor/cb_range_enabled.ll
    M llvm/test/Transforms/Attributor/cgscc_bugs.ll
    M llvm/test/Transforms/Attributor/depgraph.ll
    M llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll
    M llvm/test/Transforms/Attributor/dereferenceable-2.ll
    M llvm/test/Transforms/Attributor/heap_to_stack.ll
    M llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll
    M llvm/test/Transforms/Attributor/internalize.ll
    M llvm/test/Transforms/Attributor/memory_locations.ll
    M llvm/test/Transforms/Attributor/noalias.ll
    M llvm/test/Transforms/Attributor/nocapture-1.ll
    M llvm/test/Transforms/Attributor/nocapture-2.ll
    M llvm/test/Transforms/Attributor/nonnull.ll
    M llvm/test/Transforms/Attributor/potential.ll
    M llvm/test/Transforms/Attributor/range.ll
    M llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll
    M llvm/test/Transforms/Attributor/readattrs.ll
    M llvm/test/Transforms/Attributor/returned.ll
    M llvm/test/Transforms/Attributor/undefined_behavior.ll
    M llvm/test/Transforms/Attributor/value-simplify.ll
    M llvm/test/Transforms/OpenMP/replace_globalization.ll

  Log Message:
  -----------
  [Attributor] Use AAValueSimplify to simplify returned values

We should use AAValueSimplify for all value simplification, however
there was some leftover logic that predates AAValueSimplify in
AAReturnedValues. This remove the AAReturnedValues part and provides a
replacement by making AAValueSimplifyReturned strong enough to handle
all previously covered cases. Further, this improve
AAValueSimplifyCallSiteReturned to handle returned arguments.

AAReturnedValues is now much easier and the collected returned
values/instructions are now from the associated function only, making it
much more sane. We also do not have the brittle logic anymore that looks
for unresolved calls. Instead, we use AAValueSimplify to handle
recursion.

Useful code has been split into helper functions, e.g., an Attributor
interface to get a simplified value.

Differential Revision: https://reviews.llvm.org/D103860


Compare: https://github.com/llvm/llvm-project/compare/d3e749133319...5ef18e242183


More information about the All-commits mailing list