[all-commits] [llvm/llvm-project] fd691f: [InstCombine] Add tests for `icmp eq/ne ({su}div e...

goldsteinn via All-commits all-commits at lists.llvm.org
Thu Jul 13 17:37:25 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd691fce59087e9830f8225598f2cbb3aea1f485
      https://github.com/llvm/llvm-project/commit/fd691fce59087e9830f8225598f2cbb3aea1f485
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-07-13 (Thu, 13 Jul 2023)

  Changed paths:
    A llvm/test/Transforms/InstCombine/sdiv-icmp.ll

  Log Message:
  -----------
  [InstCombine] Add tests for `icmp eq/ne ({su}div exact X, Y), C`; NFC

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


  Commit: ddd18d02c71be4b683a2f9440c7c0d9c4ca4abe8
      https://github.com/llvm/llvm-project/commit/ddd18d02c71be4b683a2f9440c7c0d9c4ca4abe8
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2023-07-13 (Thu, 13 Jul 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/sdiv-icmp.ll

  Log Message:
  -----------
  [InstCombine] Transform `icmp eq/ne ({su}div exact X,Y),C` -> `icmp eq/ne X, Y*C`

We can do this if `Y*C` doesn't overflow. This is trivial if `C` is
0/1. Otherwise we actually generate a `mul` instruction iff the `div`
has one use.

Alive2 Links:
    udiv: https://alive2.llvm.org/ce/z/GWPW67
    sdiv: https://alive2.llvm.org/ce/z/bUoX9h

Reviewed By: nikic

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


Compare: https://github.com/llvm/llvm-project/compare/a01d1831bc90...ddd18d02c71b


More information about the All-commits mailing list