[all-commits] [llvm/llvm-project] 93c93f: [NFC][SCEV] Add some tests for select->umax recogn...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Fri Feb 11 10:58:36 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 93c93fd08f1feecb9b56de75a413c0611967d4fa
      https://github.com/llvm/llvm-project/commit/93c93fd08f1feecb9b56de75a413c0611967d4fa
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M llvm/test/Analysis/ScalarEvolution/min-max-exprs.ll

  Log Message:
  -----------
  [NFC][SCEV] Add some tests for select->umax recognition

Apparently we didn't have any tests for that codepath?


  Commit: bfce0ca2036d999de2171c4ddc2d7a2dafaf711d
      https://github.com/llvm/llvm-project/commit/bfce0ca2036d999de2171c4ddc2d7a2dafaf711d
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M llvm/test/Analysis/ScalarEvolution/logical-operations.ll

  Log Message:
  -----------
  [NFC][SCEV] Add test more tests for umin_seq recognition


  Commit: a473c457f6aa7a5d734aef5a325eae30dd9e22e0
      https://github.com/llvm/llvm-project/commit/a473c457f6aa7a5d734aef5a325eae30dd9e22e0
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp

  Log Message:
  -----------
  [NFC][SCEV] `createNodeForSelectOrPHIInstWithICmpInstCond()`: dedup eq/ne pred handling


  Commit: 4d0c0e6cc250e0637548f8a8519a95f15b6fab2e
      https://github.com/llvm/llvm-project/commit/4d0c0e6cc250e0637548f8a8519a95f15b6fab2e
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/test/Analysis/ScalarEvolution/logical-operations.ll
    M llvm/test/Analysis/ScalarEvolution/min-max-exprs.ll
    M polly/test/ForwardOpTree/changed-kind.ll

  Log Message:
  -----------
  [SCEV] `createNodeForSelectOrPHIInstWithICmpInstCond()`: generalize eq handling

The current logic was: https://alive2.llvm.org/ce/z/j8muXk
but in reality the offset to the Y in the 'true' hand
does not need to exist: https://alive2.llvm.org/ce/z/MNQ7DZ
https://alive2.llvm.org/ce/z/S2pMQD

To catch that, instead of computing the Y's in both
hands and checking their equality, compute Y and C,
and check that C is 0 or 1.


  Commit: 281421693bc1fb44c98ff719c5e3d2efb9c88830
      https://github.com/llvm/llvm-project/commit/281421693bc1fb44c98ff719c5e3d2efb9c88830
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/test/Analysis/ScalarEvolution/logical-operations.ll

  Log Message:
  -----------
  [SCEV] Recognize `x == 0 ? 0 : umin(..., x, ...)  ->  umin_seq(x, umin(...))`

That is the canonical expansion for umin_seq,
so we really should roundtrip it.


  Commit: c234809ff855b6d850e1133b2c8414fe67de3c18
      https://github.com/llvm/llvm-project/commit/c234809ff855b6d850e1133b2c8414fe67de3c18
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/test/Analysis/ScalarEvolution/logical-operations.ll

  Log Message:
  -----------
  [SCEV] Recognize `x == 0 ? 0 : umin_seq(..., x, ...)  ->  umin_seq(x, umin_seq(...))`


  Commit: 65715ac72aedd2219e06815983e20d60986c9c48
      https://github.com/llvm/llvm-project/commit/65715ac72aedd2219e06815983e20d60986c9c48
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/test/Analysis/ScalarEvolution/logical-operations.ll

  Log Message:
  -----------
  [SCEV] Generalize umin_seq matching

Since we don't greedily flatten `umin_seq(a, umin(b, c))` into `umin_seq(a, b, c)`,
just looking at the operands of the outer-level `umin` is not sufficient,
and we need to recurse into all same-typed `umin`'s.


  Commit: 97484f46eb7e8b90c42103925199caf93cc4aafd
      https://github.com/llvm/llvm-project/commit/97484f46eb7e8b90c42103925199caf93cc4aafd
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
    M llvm/lib/Analysis/ScalarEvolution.cpp

  Log Message:
  -----------
  [NFCI][SCEV] `SCEVTraversal`: if search terminated, don't push further ops of nary

Even if the search is marked as terminated after only looking at
the first operand, we'd still look at the remaining operands
before actually ending the search.

This seems pointless and wasteful, let's not do that.


Compare: https://github.com/llvm/llvm-project/compare/f810b40c3b51...97484f46eb7e


More information about the All-commits mailing list