[InstCombine] choose 1 form of abs and nabs as canonical

We already do this for min/max (see the blob above the diff), 
so we should do the same for abs/nabs.
A sign-bit check (<s 0) is used as a predicate for other IR 
transforms and it's likely the best for codegen.

This might solve the motivating cases for D47037 and D47041, 
but I think those patches still make sense. We can't guarantee 
this canonicalization if the icmp has more than one use.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332819 91177308-0d34-0410-b5e6-96231b3b80d8
7 files changed