[PATCH] D81013: [InstCombine] move vector select ahead of select-shuffle

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 14:57:16 PDT 2020


spatel added a comment.

In D81013#2074725 <https://reviews.llvm.org/D81013#2074725>, @lebedev.ri wrote:

> This should do the trick, but my `opt` is out-of-date to check
>
>   define <5 x i8> @widening(<4 x i8> %x, <4 x i8> %y, <5 x i8> %x2, <5 x i1> %cmp) {
>     %blend = shufflevector <4 x i8> %x, <4 x i8> %y, <5 x i32> <i32 0, i32 5, i32 2, i32 7, i32 7>
>     %r = select <5 x i1> %cmp, <5 x i8> %blend, <5 x i8> %x2
>     ret <5 x i8> %r
>   }
>


I couldn't find a widening version that fails, but the narrowing variant does it:
rG192cb718361dbd7be082bc0893f43bbc9782288f <https://reviews.llvm.org/rG192cb718361dbd7be082bc0893f43bbc9782288f>

@srj - sorry about the crashing. Let me know if there are still problems.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81013/new/

https://reviews.llvm.org/D81013





More information about the llvm-commits mailing list