[all-commits] [llvm/llvm-project] 8df376: [InstCombine] Remove buggy zext of icmp eq with po...

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Sep 22 07:37:29 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8df376db7282b955e7990cb8887ee9dcd3565040
      https://github.com/llvm/llvm-project/commit/8df376db7282b955e7990cb8887ee9dcd3565040
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-09-22 (Thu, 22 Sep 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
    M llvm/test/Transforms/InstCombine/zext.ll

  Log Message:
  -----------
  [InstCombine] Remove buggy zext of icmp eq with pow2 fold (PR57899)

For the case where the constant is a power of two rather than zero,
the fold is incorrect, because it fails to check that the bit set
in the LHS matches the bit in the RHS.

Rather than fixing this, remove the power of two handling entirely,
as a different fold will already canonicalize such comparisons to
use a zero constant.

Fixes https://github.com/llvm/llvm-project/issues/57899.




More information about the All-commits mailing list