[InstCombine][x86] try harder to convert blendv intrinsic to generic IR (PR38814)
authorSanjay Patel <spatel@rotateright.com>
Sat, 15 Sep 2018 14:25:44 +0000 (14:25 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sat, 15 Sep 2018 14:25:44 +0000 (14:25 +0000)
commit296d35a5e9598c9cc7619dc4e45921a9e637b38b
treea9dfe350966e167f36b149966e1c173dcb5a22a0
parent7bfe87181daaab8d19b8635031fe5835e067b115
[InstCombine][x86] try harder to convert blendv intrinsic to generic IR (PR38814)

Missing optimizations with blendv are shown in:
https://bugs.llvm.org/show_bug.cgi?id=38814

If this works, it's an easier and more powerful solution than adding pattern matching
for a few special cases in the backend. The potential danger with this transform in IR
is that the condition value can get separated from the select, and the backend might
not be able to make a blendv out of it again. I don't think that's too likely, but
I've kept this patch minimal with a 'TODO', so we can test that theory in the wild
before expanding the transform.

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

llvm-svn: 342324
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/X86/blend_x86.ll