[all-commits] [llvm/llvm-project] 58f2c1: [InstCombine] Fold shift of a constant into a reve...

Piotr Fusik via All-commits all-commits at lists.llvm.org
Mon Apr 27 00:00:20 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 58f2c189c4232351bd22dfdbb7ab45e084406cca
      https://github.com/llvm/llvm-project/commit/58f2c189c4232351bd22dfdbb7ab45e084406cca
  Author: Piotr Fusik <p.fusik at samsung.com>
  Date:   2026-04-27 (Mon, 27 Apr 2026)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
    A llvm/test/Transforms/InstCombine/shift-sub.ll

  Log Message:
  -----------
  [InstCombine] Fold shift of a constant into a reverse shift (#192982)

    C1 << (C2 - X) -> (C1 << C2) >> X
    C1 << (C2 ^ X) -> (C1 << C2) >> X (if equivalent to the above)
    C1 >> (C2 - X) -> (C1 >> C2) << X (right shift modes match)
    C1 >> (C2 ^ X) -> (C1 >> C2) << X (if equivalent to the above)

Proof: https://alive2.llvm.org/ce/z/q-4soi



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