[PATCH] D31509: [InstCombine] Combine vector shuffles if the same operand can be reused

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 07:32:15 PDT 2019


spatel added a comment.

In D31509#725725 <https://reviews.llvm.org/D31509#725725>, @jonpa wrote:

>   %28 = shufflevector <4 x i32> %27, <4 x i32> undef, <12 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
>   %interleaved.vec = shufflevector <12 x i32> %28, <12 x i32> undef, <12 x i32> <i32 0, i32 4, i32 8, i32 1, i32 5, i32 9, i32 2, i32 6, i32 10, i32 3, i32 7, i32 11>
>   
>
> A shuffle with undef is then shuffled again with undef...
>
> Is this a case that could be handled? I found this in a vectorized loop with -O3, with extra machine instructions as a result...


This specific example was discussed starting here:
https://bugs.llvm.org//show_bug.cgi?id=30630#c9
...and that bug is resolved.
Also, since this patch was posted, we've carved out a few more seemingly-safe target-independent shuffle transforms for concat/extract patterns, but nothing as general as proposed here.


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

https://reviews.llvm.org/D31509





More information about the llvm-commits mailing list