]> granicus.if.org Git - llvm/commit
[InstCombine] Use uadd.sat and usub.sat for canonicalization
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 27 Mar 2019 17:56:15 +0000 (17:56 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 27 Mar 2019 17:56:15 +0000 (17:56 +0000)
commita600eb60fd49a8e1d9e229d1287e3867580168ab
tree6acd9d57a1efb6998e7483ba810ffefb58719d1b
parenta3e702346eacd488e4230686d55171cfe6885cce
[InstCombine] Use uadd.sat and usub.sat for canonicalization

Start using the uadd.sat and usub.sat intrinsics for the existing
canonicalizations. These intrinsics should optimize better than
expanded IR, have better handling in the X86 backend and should
be no worse than expanded IR in other backends, as far as we know.

rL357012 already introduced use of uadd.sat for the add+umin pattern.

Differential Revision: https://reviews.llvm.org/D58872

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357103 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/saturating-add-sub.ll
test/Transforms/InstCombine/unsigned_saturated_sub.ll