[LegalizeDAG] Expand SADDO/SSUBO using SADDSAT/SSUBSAT (PR37763)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 26 Feb 2019 11:27:53 +0000 (11:27 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 26 Feb 2019 11:27:53 +0000 (11:27 +0000)
commit810fa04ac7e367ed1aa736f2c54d980bc6fc09f1
tree768fbe18dd07cfa04df8f55bd0358663294cb933
parent8335fd1923c1b7d9772dcc0e70a7d51f3773ecc0
[LegalizeDAG] Expand SADDO/SSUBO using SADDSAT/SSUBSAT (PR37763)

If SADDSAT/SSUBSAT are legal, then we can expand SADDO/SSUBO by performing a ADD/SUB and a SADDO/SSUBO and then compare the results.

I looked at doing this for UADDO/USUBO as well but as we don't have to do as many range comparisons I didn't see any/much benefit.

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

llvm-svn: 354866
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/test/CodeGen/X86/vec_saddo.ll
llvm/test/CodeGen/X86/vec_ssubo.ll