[all-commits] [llvm/llvm-project] 1bfd94: [InstCombine] Precommit tests for PR139109 (NFC)

Antonio Frighetto via All-commits all-commits at lists.llvm.org
Tue May 13 00:09:17 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1bfd94b1b90d57beeecea587bfee1a325ee4a1eb
      https://github.com/llvm/llvm-project/commit/1bfd94b1b90d57beeecea587bfee1a325ee4a1eb
  Author: Antonio Frighetto <me at antoniofrighetto.com>
  Date:   2025-05-13 (Tue, 13 May 2025)

  Changed paths:
    M llvm/test/Transforms/InstCombine/icmp-binop.ll

  Log Message:
  -----------
  [InstCombine] Precommit tests for PR139109 (NFC)


  Commit: adfd59fdb8bfff0b68e54b3ce84c88154f4de2d3
      https://github.com/llvm/llvm-project/commit/adfd59fdb8bfff0b68e54b3ce84c88154f4de2d3
  Author: Antonio Frighetto <me at antoniofrighetto.com>
  Date:   2025-05-13 (Tue, 13 May 2025)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
    M llvm/test/Transforms/InstCombine/icmp-binop.ll
    M llvm/test/Transforms/InstCombine/icmp-select.ll

  Log Message:
  -----------
  [InstCombine] Introduce `foldICmpBinOpWithConstantViaTruthTable` folding

Match icmps of binops where both operands are select with constant arms,
i.e., `icmp pred (select A ? C1 : C2) binop (select B ? C3 : C4), C5`.
Fold such patterns by creating a truth table of the possible four
constant variants, and materialize back the optimal logic from it via
`createLogicFromTable` helper. This also generalizes an existing fold,
which has therefore been dropped.

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

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


Compare: https://github.com/llvm/llvm-project/compare/9f274a95b13a...adfd59fdb8bf

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