[InstCombine] Canonicalize SPF to abs intrinsic
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 18 Dec 2020 17:50:20 +0000 (20:50 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Fri, 18 Dec 2020 18:18:14 +0000 (21:18 +0300)
commit897c985e1e21927b2870f964bb07ff293bd74407
tree41956c0b86a5a3d0ab1997fd054f1f502b3fd949
parente9289dc25f7923abff9ac762bd3f6819c0605f20
[InstCombine] Canonicalize SPF to abs intrinsic

This patch enables canonicalization of SPF_ABS and SPF_ABS
to the abs intrinsic.

This is a recommit, the original try was
05d4c4ebc2fb006b8a2bd05b24c6aba10dd2eef8,
but it was reverted due to an apparent miscompile,
which since then has just been fixed by the previous commit.

Differential Revision: https://reviews.llvm.org/D87188
12 files changed:
clang/test/CodeGen/builtins-wasm.c
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/abs-1.ll
llvm/test/Transforms/InstCombine/abs_abs.ll
llvm/test/Transforms/InstCombine/call-callconv.ll
llvm/test/Transforms/InstCombine/cttz-abs.ll
llvm/test/Transforms/InstCombine/icmp.ll
llvm/test/Transforms/InstCombine/max-of-nots.ll
llvm/test/Transforms/InstCombine/select_meta.ll
llvm/test/Transforms/InstCombine/sub-of-negatible.ll
llvm/test/Transforms/PhaseOrdering/X86/vector-reductions.ll
llvm/test/Transforms/PhaseOrdering/min-max-abs-cse.ll