[all-commits] [llvm/llvm-project] 7c4b90: [InstCombine] fix overzealous assert in icmp-shr fold

Sanjay Patel via All-commits all-commits at lists.llvm.org
Thu Jun 30 03:29:33 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7c4b90a98d3bcd54c21f5cac340c2310dbc37705
      https://github.com/llvm/llvm-project/commit/7c4b90a98d3bcd54c21f5cac340c2310dbc37705
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-06-30 (Thu, 30 Jun 2022)

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

  Log Message:
  -----------
  [InstCombine] fix overzealous assert in icmp-shr fold

The assert was added with 0399473de886595d and is correct for that
pattern, but it is off-by-1 with the enhancement in d4f39d833332.

The transforms are still correct with the new pre-condition:
https://alive2.llvm.org/ce/z/6_6ghm
https://alive2.llvm.org/ce/z/_GTBUt

And as shown in the new test, the transform is expected with
'ult' - in that case, the icmp reduces to test if the shift
amount is 0.




More information about the All-commits mailing list