[PATCH] D151468: [RISCV] Use v(f)slide1up for shuffle+insert idiom

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 26 00:05:43 PDT 2023


frasercrmck added a comment.

All of the tests are for two-element vectors. Is it worth adding further testing?

I played around with some other examples; should all of these also be lowered to this pattern?

  ; This one matches
  %vb = insertelement <4 x i8> poison, i8 %b, i64 0
  %v1 = shufflevector <4 x i8> %vb, <4 x i8> poison, <4 x i32> zeroinitializer
  %v2 = shufflevector <4 x i8> %v1, <4 x i8> %v, <4 x i32> <i32 0, i32 4, i32 5, i32 6>

  ; I wouldn't have thought the splat index should matter
  %vb = insertelement <4 x i8> poison, i8 %b, i64 0
  %v1 = shufflevector <4 x i8> %vb, <4 x i8> poison, <4 x i32> zeroinitializer
  %v2 = shufflevector <4 x i8> %v1, <4 x i8> %v, <4 x i32> <i32 1, i32 4, i32 5, i32 6>



  ; Should be the same as the first example, but doesn't match
  %vb = insertelement <4 x i8> poison, i8 %b, i64 0
  %v2 = shufflevector <4 x i8> %vb, <4 x i8> %v, <4 x i32> <i32 0, i32 4, i32 5, i32 6>

I'm admittedly a bit out of the loop and the shuffle stuff is the first to go, so I may be missing something obvious here, sorry.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151468



More information about the llvm-commits mailing list