select Cond, 0, C2 --> (zext(not Cond) << log2(C2)) if C2 is a power of 2. select Cond, C1, C2 --> (zext(Cond) << log2(C1 - C2)) + C2 if C1 -C2 is a power of 2.
This addresses some regressions in D130675 . It is a bit of a mixed bag for PowerPC .
Paths
| Differential D130765
[DAG] Turn a wider range of select of constants into math Needs ReviewPublic Authored by deadalnix on Jul 29 2022, 5:35 AM.
Details Summary select Cond, 0, C2 --> (zext(not Cond) << log2(C2)) if C2 is a power of 2. select Cond, C1, C2 --> (zext(Cond) << log2(C1 - C2)) + C2 if C1 -C2 is a power of 2. This addresses some regressions in D130675 . It is a bit of a mixed bag for PowerPC .
Diff Detail
Event Timeline
Comment Actions Fix CodeGen/PowerPC/nofpexcept.ll Ressurect select Cond, Pow2, 0 --> (zext Cond) << log2(Pow2)
Comment Actions Overall not great for PPC, but not problematic enough for me to stand in the way if this provides improvements on other targets. Herald added subscribers: • pcwang-thead, frasercrmck, luismarques and 20 others. · View Herald TranscriptNov 5 2022, 12:43 PM
Revision Contents
Diff 473452 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/PowerPC/fp-strict-conv-f128.ll
llvm/test/CodeGen/PowerPC/nofpexcept.ll
llvm/test/CodeGen/PowerPC/ppcf128-constrained-fp-intrinsics.ll
llvm/test/CodeGen/PowerPC/pr49509.ll
llvm/test/CodeGen/PowerPC/select_const.ll
llvm/test/CodeGen/RISCV/pr58511.ll
|