[all-commits] [llvm/llvm-project] 957094: [Attributor][NFC] Ignore benign uses in AAMemoryBe...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Tue Oct 6 07:33:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 957094e31b058f1b0a4bd3c76912f7d8b5b294b7
      https://github.com/llvm/llvm-project/commit/957094e31b058f1b0a4bd3c76912f7d8b5b294b7
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2020-10-06 (Tue, 06 Oct 2020)

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

  Log Message:
  -----------
  [Attributor][NFC] Ignore benign uses in AAMemoryBehaviorFloating

In AAMemoryBehaviorFloating we used to track benign uses in a SetVector.
With this change we look through benign uses eagerly to reduce the
number of elements (=Uses) we look at during an update.

The test does actually not fail prior to this commit but I already wrote
it so I kept it.


  Commit: 04f6951397cfbb892b99027bd3c0e4e0382f5458
      https://github.com/llvm/llvm-project/commit/04f6951397cfbb892b99027bd3c0e4e0382f5458
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2020-10-06 (Tue, 06 Oct 2020)

  Changed paths:
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    M llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll
    M llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.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/align.ll
    M llvm/test/Transforms/Attributor/depgraph.ll
    M llvm/test/Transforms/Attributor/noalias.ll
    M llvm/test/Transforms/Attributor/readattrs.ll

  Log Message:
  -----------
  [Attributor][FIX] Dead return values are not `noundef`

When we assume a return value is dead we might still visit return
instructions via `Attributor::checkForAllReturnedValuesAndReturnInsts(..)`.
When we do so the "returned value" is potentially simplified to `undef`
as it is the assumed "returned value". This is a problem if there was a
preexisting `noundef` attribute that will only be removed as we manifest
the `undef` return value. We should not use this combination to derive
`unreachable` though. Two test cases fixed.


  Commit: 4a7a988442dfa40309b34746218c07ebf758b378
      https://github.com/llvm/llvm-project/commit/4a7a988442dfa40309b34746218c07ebf758b378
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2020-10-06 (Tue, 06 Oct 2020)

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

  Log Message:
  -----------
  [Attributor][FIX] Move assertion to make it not trivially fail

The idea of this assertion was to check the simplified value before we
assign it, not after, which caused this to trivially fail all the time.


Compare: https://github.com/llvm/llvm-project/compare/66e4f0719876...4a7a988442df


More information about the All-commits mailing list