[InstCombine] add folds for minnum(-a, -b) --> -maxnum(a, b)
authorSanjay Patel <spatel@rotateright.com>
Thu, 10 May 2018 20:03:13 +0000 (20:03 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 10 May 2018 20:03:13 +0000 (20:03 +0000)
commitc7bb14301acddcfd10df1489beee1d649a83613b
treebfaa063a6ee6f6db82e8aba67cd020b94e54c94a
parentf2b6915ed46ebfc28f450b0fa0027b6666ebcb11
[InstCombine] add folds for minnum(-a, -b) --> -maxnum(a, b)

This is similar to what we do for integer min/max with 'not'
ops (rL321882).

This should fix:
https://bugs.llvm.org/show_bug.cgi?id=37404
https://bugs.llvm.org/show_bug.cgi?id=37405

llvm-svn: 332031
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/maxnum.ll
llvm/test/Transforms/InstCombine/minnum.ll