[all-commits] [llvm/llvm-project] abf69a: [InstCombine] Fold `(x < y) ? -1 : zext(x != y)` i...

Volodymyr Vasylkun via All-commits all-commits at lists.llvm.org
Mon Aug 19 05:02:50 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: abf69a167bbc99054871e3f9cc8810bbebcb6747
      https://github.com/llvm/llvm-project/commit/abf69a167bbc99054871e3f9cc8810bbebcb6747
  Author: Volodymyr Vasylkun <vvmposeydon at gmail.com>
  Date:   2024-08-19 (Mon, 19 Aug 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/scmp.ll
    M llvm/test/Transforms/InstCombine/select-select.ll
    M llvm/test/Transforms/InstCombine/ucmp.ll
    M llvm/test/Transforms/PhaseOrdering/partialord-ule.ll

  Log Message:
  -----------
  [InstCombine] Fold `(x < y) ? -1 : zext(x != y)` into `u/scmp(x,y)` (#101049)

This patch adds the aforementioned fold to InstCombine. This pattern is
produced after naive implementations of 3-way comparison in high-level
languages are transformed into LLVM IR and then optimized.

Proofs: https://alive2.llvm.org/ce/z/w4QLq_



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list