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

Keno Fischer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 13:41:11 PDT 2017


loladiro added a comment.

The shuffles in my test case are equivalent to vector concatenation, but I have a local test case which is more complicated. Do you have a specific example where the backend would generate better code with having the middle end generate code of the form:

  v1 = %shufflevector %v, undef, mask1
  v2 = %shufflevector %v, undef, mask2
  %shufflevector %v1, v2, mask3

than

  %shufflevector %v, undef, mask4

I would have hoped that just lowering a shuffle of one vector would have sufficiently improved in the backend by now. You also mentioned this was a limitation for large vector types. Does it make sense to have a TTI hook to determine whether the target can efficiently lower such shuffles?


https://reviews.llvm.org/D31509





More information about the llvm-commits mailing list