[all-commits] [llvm/llvm-project] 114569: [InstCombine] Add tests for folding `(mul (div exa...

goldsteinn via All-commits all-commits at lists.llvm.org
Fri Jun 28 01:52:37 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 11456944d481b5d1b139e346ea7992c0b692781a
      https://github.com/llvm/llvm-project/commit/11456944d481b5d1b139e346ea7992c0b692781a
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2024-06-28 (Fri, 28 Jun 2024)

  Changed paths:
    M llvm/test/Transforms/InstCombine/exact.ll

  Log Message:
  -----------
  [InstCombine] Add tests for folding `(mul (div exact X, C0), C1)`; NFC


  Commit: afa3d58ee2224f1037116f4cab44a23bd232a416
      https://github.com/llvm/llvm-project/commit/afa3d58ee2224f1037116f4cab44a23bd232a416
  Author: Noah Goldstein <goldstein.w.n at gmail.com>
  Date:   2024-06-28 (Fri, 28 Jun 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
    M llvm/test/Transforms/InstCombine/exact.ll

  Log Message:
  -----------
  [InstCombine] Fold `(mul (div exact X, C0), C1)` -> `(div exact X, C0/C1)`

We can do this if `C0 % C1 == 0` and if we avoid UB in the signed
case.

Proofs: https://alive2.llvm.org/ce/z/HHWHDg

Closes #96915


Compare: https://github.com/llvm/llvm-project/compare/e3796291abd8...afa3d58ee222

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list