[InstCombine] re-use bitcasted compare operands in selects (PR28001)
authorSanjay Patel <spatel@rotateright.com>
Sat, 29 Oct 2016 15:22:04 +0000 (15:22 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sat, 29 Oct 2016 15:22:04 +0000 (15:22 +0000)
commit978f827d122bad37e21081fc32fad6b7d8b6edea
treeb3f62c76797d2d70232230bccadfa9b68fc5aae0
parent75a697a17ea3084fadb83737227f36c142a3c7bb
[InstCombine] re-use bitcasted compare operands in selects (PR28001)

These mixed bitcast patterns show up with SSE/AVX intrinsics because we bitcast function parameters to <2 x i64>.

The bitcasts obfuscate the expected min/max forms as shown in PR28001:
https://llvm.org/bugs/show_bug.cgi?id=28001#c6

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

llvm-svn: 285495
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/minmax-fold.ll