OSDN Git Service

[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)
commit87d94cc8a7953ac3d3de721bf3a48d3a39113c11
treee67bc63eb5c596cf96ab5dcfed890ec4251c1738
parent3dc44a9d48d1dad47912e645ab594bcbe9bb478b
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332031 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCalls.cpp
test/Transforms/InstCombine/maxnum.ll
test/Transforms/InstCombine/minnum.ll