[all-commits] [llvm/llvm-project] c42aa1: [Attributor] Keep loads feeding in `llvm.assume` i...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Tue Apr 5 21:07:47 PDT 2022


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

  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/align.ll
    M llvm/test/Transforms/Attributor/value-simplify-assume.ll

  Log Message:
  -----------
  [Attributor] Keep loads feeding in `llvm.assume` if stores stays

If a load is only used by an `llvm.assume` and the stores feeding into
the load are not removable, keep the load.


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

  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/alloca-as.ll
    M llvm/test/Transforms/Attributor/callbacks.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/norecurse.ll
    M llvm/test/Transforms/Attributor/value-simplify-assume.ll
    M llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
    M llvm/test/Transforms/OpenMP/parallel_region_merging.ll

  Log Message:
  -----------
  [Attributor] Introduce AAInstanceInfo

The Attributor, as many other parts in LLVM, uses pointer equivalence
for `llvm::Value`s. This only works as long as `llvm::Value`s are
dynamically unique, or, to be exact, we will never end up with the same
`llvm::Value` representing two dynamic instances. We already provided a
helper to check the former, namely `AA::isDynamicallyUnique`, however we
could not check the latter. In this patch we move the logic into a
separate AA which helps with the growing complexity and use cases. We
also extend the interface to answer the second question rather than the
first. So we do not determine dynamically uniqueness but if we might end
up with the `llvm::Value` describing a different dynamic instance. Note
that the latter is very much tied to the Attributor capabilities to look
through memory, recursion, etc. so we need to update the logic as we go.


Compare: https://github.com/llvm/llvm-project/compare/68470811608d...af30de7788e1


More information about the All-commits mailing list