[SelectionDAGBuilder] Add SPF_NABS support to visitSelect
authorCraig Topper <craig.topper@sifive.com>
Wed, 25 Nov 2020 22:54:26 +0000 (14:54 -0800)
committerCraig Topper <craig.topper@sifive.com>
Wed, 25 Nov 2020 22:54:26 +0000 (14:54 -0800)
commit2d6042937b04eef00672b5c4ce623bf8f7b9a201
tree24aa2730547f676c057ae2884093952d69adf2c0
parentc9eae09251e3e7d5a77a5970dfd59a4e81c9b936
[SelectionDAGBuilder] Add SPF_NABS support to visitSelect

We currently don't match this which limits the effectiveness of D91120 until
InstCombine starts canonicalizing to llvm.abs. This should be easy to remove
if/when we remove the SPF_ABS handling.

Differential Revision: https://reviews.llvm.org/D92118
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/PowerPC/select.ll
llvm/test/CodeGen/RISCV/neg-abs.ll