[all-commits] [llvm/llvm-project] 8c124c: [InstCombine] (ShiftValC >> Y) >s -1/<s 0 --> Y !=...

ZCBing via All-commits all-commits at lists.llvm.org
Wed Jul 20 19:16:20 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c124c908857f7018ed032011046a2a38faf2307
      https://github.com/llvm/llvm-project/commit/8c124c908857f7018ed032011046a2a38faf2307
  Author: Chenbing Zheng <Chenbing.Zheng at streamcomputing.com>
  Date:   2022-07-21 (Thu, 21 Jul 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/icmp-shr.ll

  Log Message:
  -----------
  [InstCombine] (ShiftValC >> Y) >s -1/<s 0 --> Y != 0/==0

We can do folds (ShiftValC >> Y) >s -1 --> Y != 0 and
(ShiftValC >> Y) <s 0 --> Y == 0, with ShiftValC < 0.

Alive2: https://alive2.llvm.org/ce/z/-PRHfD

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D129726




More information about the All-commits mailing list