[all-commits] [llvm/llvm-project] a0c3c6: [InstCombine] fold shift-right-by-constant with sh...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Mon May 30 12:34:22 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a0c3c60728ee5bc7d6ca40a5b6e446cde72c6700
      https://github.com/llvm/llvm-project/commit/a0c3c60728ee5bc7d6ca40a5b6e446cde72c6700
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-05-30 (Mon, 30 May 2022)

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

  Log Message:
  -----------
  [InstCombine] fold shift-right-by-constant with shift-right-of-constant operand

  (C2 >> X) >> C1 --> (C2 >> C1) >> X

The shift-left form of this transform has existed since:
16f18ed7b555bce5163

...but it applies to matching shift right opcodes too:
https://alive2.llvm.org/ce/z/c5eQms




More information about the All-commits mailing list