[all-commits] [llvm/llvm-project] b3b333: [InstCombine] Simplify the pattern `a ne/eq (zext/...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Fri Oct 6 05:58:12 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b3b3336e82763d8c216c1dacf4d7c60c8513db0d
      https://github.com/llvm/llvm-project/commit/b3b3336e82763d8c216c1dacf4d7c60c8513db0d
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2023-10-06 (Fri, 06 Oct 2023)

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

  Log Message:
  -----------
  [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (#65852)

This patch folds the pattern `a ne/eq (zext/sext (a ne/eq c))` into a boolean constant or a compare.
Clang vs GCC: https://godbolt.org/z/4ro817WE8
Proof for `zext`: https://alive2.llvm.org/ce/z/6z9NRF
Proof for `sext`: https://alive2.llvm.org/ce/z/tv5wuE
Fixes #65073.




More information about the All-commits mailing list