[InstCombine] Call getCmpPredicateForMinMax only with a valid SPF
authorSanjoy Das <sanjoy@playingwithpointers.com>
Sat, 5 Dec 2015 23:44:22 +0000 (23:44 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Sat, 5 Dec 2015 23:44:22 +0000 (23:44 +0000)
commita8231e7f59c2f43d11c387030e5e0c29670bd5a9
tree7c53c89e8d303149d2f194d269794a7ebd90f350
parent3aa1034794ef6a4c9b9196c00debbd318b36fdd3
[InstCombine] Call getCmpPredicateForMinMax only with a valid SPF

Summary:
There are `SelectPatternFlavor`s that don't represent min or max idioms,
and we should not be passing those to `getCmpPredicateForMinMax`.

Fixes PR25745.

Reviewers: majnemer

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15249

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254869 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ValueTracking.h
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/pr25745.ll [new file with mode: 0644]