[all-commits] [llvm/llvm-project] 2d5f07: [InstCombine] Fold `X udiv Y` to `X lshr cttz(Y)` ...

Veera via All-commits all-commits at lists.llvm.org
Fri Jan 10 21:56:35 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d5f07c82836bde6f5ae16518931a78783a22ec8
      https://github.com/llvm/llvm-project/commit/2d5f07c82836bde6f5ae16518931a78783a22ec8
  Author: Veera <32646674+veera-sivarajan at users.noreply.github.com>
  Date:   2025-01-11 (Sat, 11 Jan 2025)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
    M llvm/test/Transforms/IndVarSimplify/rewrite-loop-exit-value.ll
    M llvm/test/Transforms/InstCombine/div-shift.ll

  Log Message:
  -----------
  [InstCombine] Fold `X udiv Y` to `X lshr cttz(Y)` if Y is a power of 2 (#121386)

Fixes #115767

This PR folds `X udiv Y` to `X lshr cttz(Y)` if Y is a power of two
since bitwise operations are faster than division.

Proof: https://alive2.llvm.org/ce/z/qHmLta



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