You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[AArch64][SVE2] Use rshrnb for masked stores (#70026)
This patch is a follow up on https://reviews.llvm.org/D155299. This
patch combines add+lsr to rshrnb when 'B' in:
C = A + B
D = C >> Shift
is equal to (1 << (Shift-1), and the bits in the top half of each vector
element are zeroed or ignored, such as in a truncating masked store.
definevoid@masked_store_rshrnb(ptr%ptr, ptr%dst, i64%index, <vscale x 8 x i1> %mask) { ; preds = %vector.body, %vector.ph
303
+
; CHECK-LABEL: masked_store_rshrnb:
304
+
; CHECK: // %bb.0:
305
+
; CHECK-NEXT: ld1h { z0.h }, p0/z, [x0]
306
+
; CHECK-NEXT: rshrnb z0.b, z0.h, #6
307
+
; CHECK-NEXT: st1b { z0.h }, p0, [x1, x2]
308
+
; CHECK-NEXT: ret
309
+
%wide.masked.load = tailcall <vscale x 8 x i16> @llvm.masked.load.nxv8i16.p0(ptr%ptr, i322, <vscale x 8 x i1> %mask, <vscale x 8 x i16> poison)
310
+
%1 = add <vscale x 8 x i16> %wide.masked.load, trunc (<vscale x 8 x i32> shufflevector (<vscale x 8 x i32> insertelement (<vscale x 8 x i32> poison, i3232, i640), <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer) to <vscale x 8 x i16>)
311
+
%2 = lshr <vscale x 8 x i16> %1, trunc (<vscale x 8 x i32> shufflevector (<vscale x 8 x i32> insertelement (<vscale x 8 x i32> poison, i326, i640), <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer) to <vscale x 8 x i16>)
312
+
%3 = trunc <vscale x 8 x i16> %2to <vscale x 8 x i8>
313
+
%4 = getelementptrinboundsi8, ptr%dst, i64%index
314
+
tailcallvoid@llvm.masked.store.nxv8i8.p0(<vscale x 8 x i8> %3, ptr%4, i321, <vscale x 8 x i1> %mask)
315
+
retvoid
316
+
}
317
+
318
+
declarevoid@llvm.masked.store.nxv8i8.p0(<vscale x 8 x i8>, ptr, i32, <vscale x 8 x i1>)
319
+
declare <vscale x 8 x i16> @llvm.masked.load.nxv8i16.p0(ptr, i32, <vscale x 8 x i1>, <vscale x 8 x i16>)
0 commit comments