New instcombine rule: max(~a,~b) -> ~min(a, b)
authorSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 24 Feb 2015 00:08:41 +0000 (00:08 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 24 Feb 2015 00:08:41 +0000 (00:08 +0000)
commitf922d9cfe41112b79ac3cad9f5758f1ff3ad77cc
tree8f66d161146a0f3a31d4f7344ab707d1b18d4b0a
parent8d16a81c331e641b12464d32a0c35d819ab1b5ee
New instcombine rule: max(~a,~b) -> ~min(a, b)

This case is interesting because ScalarEvolutionExpander lowers min(a,
b) as ~max(~a,~b).  I think the profitability heuristics can be made
more clever/aggressive, but this is a start.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230285 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
lib/Transforms/InstCombine/InstCombineInternal.h
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/max-of-nots.ll [new file with mode: 0644]