[llvm-branch-commits] [llvm] [LoongArch] Custom legalize vector_shuffle to `[x]vpermi.w` (PR #164945)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Apr 28 02:57:31 PDT 2026
================
@@ -50,7 +51,8 @@ define <8 x i16> @widen_shuffle_mask_v8i16_to_v4i32(<8 x i16> %a, <8 x i16> %b)
define <8 x i16> @widen_shuffle_mask_v8i16_to_v2i64(<8 x i16> %a, <8 x i16> %b) {
; CHECK-LABEL: widen_shuffle_mask_v8i16_to_v2i64:
; CHECK: # %bb.0:
-; CHECK-NEXT: vshuf4i.d $vr0, $vr1, 12
+; CHECK-NEXT: vpermi.w $vr1, $vr0, 228
+; CHECK-NEXT: vori.b $vr0, $vr1, 0
----------------
zhaoqi5 wrote:
I think the extra register move will not appear on real world programs. The reason why it is needed here is that the reture result is vector type, and it should be in `vr0`. (... by the way, if exchanging `%a` and `%b`, the extra move is not needed, but needed if using `vshuf4i.d`.)
https://github.com/llvm/llvm-project/pull/164945
More information about the llvm-branch-commits
mailing list