[all-commits] [llvm/llvm-project] adddd3: [Attributor] Introduce getPotentialCopiesOfStoredV...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Mon Jul 26 21:34:04 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: adddd3dbdae074285f879c5eb7369a92fdd99117
      https://github.com/llvm/llvm-project/commit/adddd3dbdae074285f879c5eb7369a92fdd99117
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2021-07-26 (Mon, 26 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/byval-2.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll
    M llvm/test/Transforms/Attributor/nodelete.ll
    M llvm/test/Transforms/Attributor/value-simplify.ll
    M llvm/test/Transforms/OpenMP/custom_state_machines.ll
    M llvm/test/Transforms/OpenMP/spmdization.ll

  Log Message:
  -----------
  [Attributor] Introduce getPotentialCopiesOfStoredValue and use it

This patch introduces `getPotentialCopiesOfStoredValue` which uses
AAPointerInfo to determine all "aliases" or "potential copies" of a
value that is stored into memory. This operation can fail but if it
succeeds it means we can visit all "uses" of a value even if it is
temporarily stored in memory.

There are two users for the function:
  1) `Attributor::checkForAllUses` which will now ignore the value use
     in a store if all "potential copies" can be identified and instead
     be visited. This allows various AAs, including AAPointerInfo
     itself, to look through memory.
  2) `AANoCapture` which uses a custom use tracking through the
     CaptureTracker interface and therefore needs to be thought
     explicitly.

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


  Commit: 41bd26dff9869a0d72f95ed750a82136f1bccc81
      https://github.com/llvm/llvm-project/commit/41bd26dff9869a0d72f95ed750a82136f1bccc81
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2021-07-26 (Mon, 26 Jul 2021)

  Changed paths:
    M llvm/include/llvm/Transforms/IPO/Attributor.h
    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/basictest.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/profile.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll
    M llvm/test/Transforms/Attributor/internal-noalias.ll
    M llvm/test/Transforms/Attributor/misc_crash.ll
    M llvm/test/Transforms/Attributor/nodelete.ll
    M llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
    M llvm/test/Transforms/Attributor/value-simplify.ll
    M llvm/test/Transforms/Attributor/wrapper.ll
    M llvm/test/Transforms/OpenMP/custom_state_machines.ll
    M llvm/test/Transforms/OpenMP/spmdization.ll

  Log Message:
  -----------
  [Attributor] Delete dead stores

D106185 allows us to determine if a store is needed easily. Using that
knowledge we can start to delete dead stores.

In AAIsDead we now track more state as an instruction can be dead (= the
old optimisitc state) or just "removable". A store instruction can be
removable while being very much alive, e.g., if it stores a constant
into an alloca or internal global. If we would pretend it was dead
instead of only removablewe we would ignore it when we determine what
values a load can see, so that is not what we want.

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


  Commit: 25a3130d89f00f53a23f7fc38250d5dc43e29cfb
      https://github.com/llvm/llvm-project/commit/25a3130d89f00f53a23f7fc38250d5dc43e29cfb
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2021-07-26 (Mon, 26 Jul 2021)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/Local.h
    M llvm/lib/CodeGen/WinEHPrepare.cpp
    M llvm/lib/Transforms/Coroutines/CoroSplit.cpp
    M llvm/lib/Transforms/Coroutines/Coroutines.cpp
    M llvm/lib/Transforms/IPO/Attributor.cpp
    M llvm/lib/Transforms/IPO/PruneEH.cpp
    M llvm/lib/Transforms/Scalar/SCCP.cpp
    M llvm/lib/Transforms/Utils/InlineFunction.cpp
    M llvm/lib/Transforms/Utils/Local.cpp
    M llvm/lib/Transforms/Utils/LoopSimplify.cpp
    M llvm/lib/Transforms/Utils/LoopUnroll.cpp
    M llvm/lib/Transforms/Utils/LoopUtils.cpp
    M llvm/test/CodeGen/ARM/vmul.ll
    M llvm/test/CodeGen/Hexagon/swp-art-deps-rec.ll
    M llvm/test/CodeGen/Thumb2/ifcvt-rescan-diamonds.ll
    M llvm/test/Transforms/SimplifyCFG/invoke.ll
    M llvm/test/Transforms/SimplifyCFG/trap-debugloc.ll
    M llvm/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll
    M llvm/unittests/Transforms/Utils/LocalTest.cpp

  Log Message:
  -----------
  [Local] Do not introduce a new `llvm.trap` before `unreachable`

This is the second attempt to remove the `llvm.trap` insertion after
https://reviews.llvm.org/rGe14e7bc4b889dfaffb7180d176a03311df2d4ae6
reverted the first one. It is not clear what the exact issue was back
then and it might already be gone by now, it has been >5 years after
all.

Replaces D106299.

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


Compare: https://github.com/llvm/llvm-project/compare/402461beb051...25a3130d89f0


More information about the All-commits mailing list