Files
clang-p2996/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
Noah Goldstein 0310f7f2d0 [InstCombine] Fold (add X, (sext/zext (icmp eq X, C)))
We can convert this to a select based on the `(icmp eq X, C)`, then
constant fold the addition the true arm begin `(add C, (sext/zext 1))`
and the false arm being `(add X, 0)` e.g

    - `(select (icmp eq X, C), (add C, (sext/zext 1)), (add X, 0))`.

This is essentially a specialization of the only case that sees to
actually show up from #89020

Closes #93840
2024-06-01 17:49:15 -05:00

107 KiB