[PATCH] D134257: [WebAssembly] Improve codegen for loading scalars from memory to v128

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 07:44:48 PDT 2022


tlively accepted this revision.
tlively added a comment.
This revision is now accepted and ready to land.

Thanks! Do you need me to land this?



================
Comment at: llvm/test/CodeGen/WebAssembly/simd-offset.ll:1196-1199
+; CHECK-NEXT:    i32.const 24
+; CHECK-NEXT:    i32x4.shl
+; CHECK-NEXT:    i32.const 24
+; CHECK-NEXT:    i32x4.shr_s
----------------
fanchenkong1 wrote:
> tlively wrote:
> > It looks like there is some room for improvement here. These shifts aren't necessary, are they? It would be good to at least add a TODO about cleaning them up.
> Yes, a TODO can be added if further change is needed. But I'm not sure if I fully understand what to do to remove the shifts. Does it mean by using two sign extend? e.g.
>   i16x8.extend_low_i8x16_s
>   i32x4.extend_low_i16x8_s
Oh, I see, we need the shifts because they implement the sign extend part. Using the sequence of `extend_low` instructions is also a good idea. How would the native code from that solution compare?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134257



More information about the llvm-commits mailing list