OSDN Git Service

[InstCombine] Do not exercise nested max/min pattern on abs
authorAnna Thomas <anna@azul.com>
Tue, 21 Feb 2017 14:40:28 +0000 (14:40 +0000)
committerAnna Thomas <anna@azul.com>
Tue, 21 Feb 2017 14:40:28 +0000 (14:40 +0000)
commit20c0e163afb537231da605a06d1d112cde44fe42
tree9d2fbc522ff39aefc7c7ce4135cb5adfed66eaaa
parent253f60a6d819e3ea3d7e614b6de3f23ede8aeb16
[InstCombine] Do not exercise nested max/min pattern on abs

Summary:
This is a fix for assertion failure in
`getInverseMinMaxSelectPattern` when ABS is passed in as a select pattern.

We should not be invoking the simplification rule for
ABS(MIN(~ x,y))) or ABS(MAX(~x,y)) combinations.

Added a test case which would cause an assertion failure without the patch.

Reviewers: sanjoy, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295719 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/max-of-nots.ll