diff options
| author | Antonio Frighetto <me@antoniofrighetto.com> | 2025-05-13 09:04:25 +0200 | 
|---|---|---|
| committer | Antonio Frighetto <me@antoniofrighetto.com> | 2025-05-13 09:04:25 +0200 | 
| commit | adfd59fdb8bfff0b68e54b3ce84c88154f4de2d3 (patch) | |
| tree | 8b5bd4ea2982086bb28ad438ba69ce67fd155d39 /clang/lib/CodeGen/ModuleBuilder.cpp | |
| parent | 1bfd94b1b90d57beeecea587bfee1a325ee4a1eb (diff) | |
| download | llvm-adfd59fdb8bfff0b68e54b3ce84c88154f4de2d3.zip llvm-adfd59fdb8bfff0b68e54b3ce84c88154f4de2d3.tar.gz llvm-adfd59fdb8bfff0b68e54b3ce84c88154f4de2d3.tar.bz2  | |
[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.
Diffstat (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp')
0 files changed, 0 insertions, 0 deletions
