[all-commits] [llvm/llvm-project] e7999f: [ValueTracking] Add more tests for `shl` isKnownNo...

goldsteinn via All-commits all-commits at lists.llvm.org
Fri Apr 14 16:24:06 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e7999fb42da0e598540e4015fc05c31b3e9cce75
      https://github.com/llvm/llvm-project/commit/e7999fb42da0e598540e4015fc05c31b3e9cce75
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-04-14 (Fri, 14 Apr 2023)

  Changed paths:
    M llvm/test/Analysis/ValueTracking/known-non-zero.ll

  Log Message:
  -----------
  [ValueTracking] Add more tests for `shl` isKnownNonZero; NFC

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


  Commit: 684963b86db3d4d1eebd3985b8161af90187e938
      https://github.com/llvm/llvm-project/commit/684963b86db3d4d1eebd3985b8161af90187e938
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-04-14 (Fri, 14 Apr 2023)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Analysis/ValueTracking/known-non-zero.ll

  Log Message:
  -----------
  [ValueTracking] Use maximum shift count in `shl` when determining if `shl` can be zero.

Previously only return `shl` non-zero if the shift value was `1`. We
can expand this if we have some bounds on the shift count.

For example:
    ```
    %cnt = and %c, 16 ; Max cnt == 16
    %val = or %v, 4 ; val[2] is known one
    %shl = shl %val, %cnt ; (val.known.one << cnt.maxval) != 0
    ```

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


  Commit: f688d215e53cdeaaa90b317bb476acd6cebabf2c
      https://github.com/llvm/llvm-project/commit/f688d215e53cdeaaa90b317bb476acd6cebabf2c
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-04-14 (Fri, 14 Apr 2023)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Analysis/ValueTracking/known-non-zero.ll

  Log Message:
  -----------
  [ValueTracking] Add `shl nsw %val, %cnt != 0` if `%val != 0`.

Alive2 Link: https://alive2.llvm.org/ce/z/mxZLJn

Reviewed By: nikic

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


Compare: https://github.com/llvm/llvm-project/compare/6b62166b4cf8...f688d215e53c


More information about the All-commits mailing list