[all-commits] [llvm/llvm-project] a8610d: [Attributor] Move recursion reasoning into `AA::is...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Tue Apr 5 18:49:37 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a8610d752306b48f914eb21108f2d1cb1fd6b710
      https://github.com/llvm/llvm-project/commit/a8610d752306b48f914eb21108f2d1cb1fd6b710
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-04-05 (Tue, 05 Apr 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/Attributor.cpp
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp

  Log Message:
  -----------
  [Attributor] Move recursion reasoning into `AA::isPotentiallyReachable`

With D106397 we ensured that `AAReachability` will not answer queries for
potentially recursive functions. This was necessary as we did not treat
recursion explicitly otherwise. Now that we have
`AA::isPotentiallyReachable` we can make `AAReachability` a purely
intra-procedural AA which does not care about recursion.
`AA::isPotentiallyReachable`, however, does already deal with "going
back" the call graph and can now do so for potentially recursive
functions.


  Commit: 857bf306d7984cb464cd0de6371df7c934c6642a
      https://github.com/llvm/llvm-project/commit/857bf306d7984cb464cd0de6371df7c934c6642a
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-04-05 (Tue, 05 Apr 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/Attributor.cpp
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    M llvm/test/Transforms/Attributor/ArgumentPromotion/alloca-as.ll
    M llvm/test/Transforms/Attributor/callbacks.ll
    M llvm/test/Transforms/Attributor/heap_to_stack.ll
    M llvm/test/Transforms/Attributor/norecurse.ll
    M llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
    M llvm/test/Transforms/Attributor/value-simplify.ll
    M llvm/test/Transforms/OpenMP/barrier_removal.ll
    M llvm/test/Transforms/OpenMP/custom_state_machines.ll
    M llvm/test/Transforms/OpenMP/parallel_region_merging.ll

  Log Message:
  -----------
  [Attributor] Remove broken and duplicated load simplification

We look through loads in the "generic value traversal" and we
consequently don't need to look through them again in AAValueSimplify*.
The test changes stem from the fact that we allowed any simplified
value, incl. non-dynamically unique ones, as long as the underlying
memory was an alloca. This doesn't seem to make sense as allocas do not
protect against dynamically non-unique values. We need to make the
unique check better rather than excluding allocas. That in mind, we can
remove a lot of code by simply relying on the generic value traversal
load look through.

To soften the blow some minor adjustments have been made that allow more
simplification through the now used scheme and some tests have been
given a `norecurse` for now.


Compare: https://github.com/llvm/llvm-project/compare/ced9a795fd84...857bf306d798


More information about the All-commits mailing list