[all-commits] [llvm/llvm-project] 8607a0: [InstSimplify] Transform X * Y % Y --> 0

David Goldblatt via All-commits all-commits at lists.llvm.org
Tue May 25 07:29:19 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8607a023574f29cbb0b3fdd26f36872ca6b4af5e
      https://github.com/llvm/llvm-project/commit/8607a023574f29cbb0b3fdd26f36872ca6b4af5e
  Author: David Goldblatt <davidtgoldblatt at gmail.com>
  Date:   2021-05-25 (Tue, 25 May 2021)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstSimplify/rem.ll

  Log Message:
  -----------
  [InstSimplify] Transform X * Y % Y --> 0

simplifyDiv already handles the case X * Y / Y --> X (barring overflow).
This adds the equivalent handling to simplifyRem.

Correctness:
https://alive2.llvm.org/ce/z/J2cUbS
https://alive2.llvm.org/ce/z/us9NUM
https://alive2.llvm.org/ce/z/AvaDGJ
https://alive2.llvm.org/ce/z/kq9ige

Extending the situations in which we apply this transform would not be
correct:
https://alive2.llvm.org/ce/z/Lf9V63
https://alive2.llvm.org/ce/z/6RPQK3
https://alive2.llvm.org/ce/z/p9UdxC
https://alive2.llvm.org/ce/z/A2zlhE
https://alive2.llvm.org/ce/z/vHTtLw
https://alive2.llvm.org/ce/z/lvpH42

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




More information about the All-commits mailing list