diff options
| author | Wenju He <wenju.he@intel.com> | 2025-11-03 07:38:21 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-03 07:38:21 +0800 |
| commit | 79bf8c0331bc7e3655e208da7ad8aa780105ac82 (patch) | |
| tree | d7b6b7212026a567e6180eb6aa462ba2074d0360 /llvm/lib/TextAPI/BinaryReader | |
| parent | 0a2741570aae981a953c5ccb9b7d5df25796a070 (diff) | |
| download | llvm-79bf8c0331bc7e3655e208da7ad8aa780105ac82.zip llvm-79bf8c0331bc7e3655e208da7ad8aa780105ac82.tar.gz llvm-79bf8c0331bc7e3655e208da7ad8aa780105ac82.tar.bz2 | |
[InstCombine] Fold select(X >s 0, 0, -X) | smax(X, 0) to abs(X) (#165200)
The IR pattern is compiled from OpenCL code:
__builtin_astype(x > (uchar2)(0) ? x : -x, uchar2);
where smax is created by foldSelectInstWithICmp + canonicalizeSPF.
smax could also come from direct elementwise max call:
int c = b > (int)(0) ? (int)(0) : -b;
int d = __builtin_elementwise_max(b, (int)(0));
*a = c | d;
https://alive2.llvm.org/ce/z/2-brvr
https://alive2.llvm.org/ce/z/Dowjzk
https://alive2.llvm.org/ce/z/kathwZ
---------
Co-authored-by: Yingwei Zheng <dtcxzyw@qq.com>
Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
Diffstat (limited to 'llvm/lib/TextAPI/BinaryReader')
0 files changed, 0 insertions, 0 deletions
