[all-commits] [llvm/llvm-project] 945eeb: [InstCombine] Simplify `(X / C0) * C1 + (X % C0) *...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Wed Apr 24 02:02:11 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 945eeb2d92758ef907ef3aeb3251fadc64b731b3
      https://github.com/llvm/llvm-project/commit/945eeb2d92758ef907ef3aeb3251fadc64b731b3
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2024-04-24 (Wed, 24 Apr 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/test/Transforms/InstCombine/add4.ll

  Log Message:
  -----------
  [InstCombine] Simplify `(X / C0) * C1 + (X % C0) * C2` to `(X / C0) * (C1 - C2 * C0) + X * C2` (#76285)

Since `DivRemPairPass` runs after `ReassociatePass` in the optimization
pipeline, I decided to do this simplification in `InstCombine`.

Alive2: https://alive2.llvm.org/ce/z/Jgsiqf
Fixes #76128.



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