[llvm] [LoongArch] Try to widen shuffle mask (PR #136081)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 24 04:25:31 PDT 2025
================
@@ -6,7 +6,8 @@ define <32 x i8> @widen_shuffle_mask_v32i8_to_v16i16(<32 x i8> %a, <32 x i8> %b)
; CHECK: # %bb.0:
; CHECK-NEXT: pcalau12i $a0, %pc_hi20(.LCPI0_0)
; CHECK-NEXT: xvld $xr2, $a0, %pc_lo12(.LCPI0_0)
-; CHECK-NEXT: xvshuf.b $xr0, $xr1, $xr0, $xr2
+; CHECK-NEXT: xvshuf.h $xr2, $xr1, $xr0
+; CHECK-NEXT: xvori.b $xr0, $xr2, 0
----------------
heiher wrote:
Is the `xvori.b` instruction redundant in this context? Since it effectively acts as a no-op copy from `$xr2` to `$xr0`, it might be possible to eliminate it entirely by adjusting the destination of the preceding `xvshuf.h` instruction. If that's safe to do here, consider folding this into the current patch.
https://github.com/llvm/llvm-project/pull/136081
More information about the llvm-commits
mailing list