[ValueTracking] recognize even more variants of smin/smax
authorSanjay Patel <spatel@rotateright.com>
Sun, 13 Nov 2016 20:04:52 +0000 (20:04 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 13 Nov 2016 20:04:52 +0000 (20:04 +0000)
commitcfcc42bdc2b880a3036337ac259f329ae56d8c22
tree0864e5f1ce5d0c4855318d3082cb67364ed13121
parentba13703bb3171afd1030262d91bda0b8e98ed6b6
[ValueTracking] recognize even more variants of smin/smax

Similar to:
https://reviews.llvm.org/rL285499
https://reviews.llvm.org/rL286318

We can't minimally expose this in IR tests because we don't have min/max intrinsics,
but the difference is visible in codegen because SelectionDAGBuilder::visitSelect()
uses matchSelectPattern().

We're not canonicalizing these patterns in IR (yet), so I don't expect there to be any
regressions as noted here:
http://lists.llvm.org/pipermail/llvm-dev/2016-November/106868.html

llvm-svn: 286776
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/CodeGen/X86/vec_minmax_match.ll