[llvm] [LoopVectorize] Enable shuffle padding for masked interleaved accesses (PR #75329)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 20:02:44 PST 2023


================
@@ -0,0 +1,279 @@
+; RUN: opt -mtriple=aarch64 -mattr=+sve -S -passes=loop-vectorize,interleaved-access  -enable-masked-interleaved-mem-accesses=true -sve-gather-overhead=10 -sve-scatter-overhead=10  -enable-shuffle-padding=true -force-vector-width=16 -aarch64-sve-vector-bits-min=512 < %s -o - | FileCheck %s --check-prefixes=ENABLE-SHUFFLE-PADDING
+; RUN: opt -mtriple=aarch64 -mattr=+sve -S -passes=loop-vectorize,interleaved-access  -enable-masked-interleaved-mem-accesses=true -sve-gather-overhead=10 -sve-scatter-overhead=10  -enable-shuffle-padding=false -force-vector-width=16  -aarch64-sve-vector-bits-min=512 < %s -o - | FileCheck %s --check-prefixes=DISABLE-SHUFFLE-PADDING
+
+%struct.patic = type { float, float, float }
+
+; for (int i = 0; i < num; i++) {
+;   ps[i].x = factor * ps[i].x;
+;   ps[i].y = factor * ps[i].y;
+; }
+;
+; Function Attrs: argmemonly mustprogress nofree norecurse nosync nounwind uwtable vscale_range(2,2)
+define void @test(i32 noundef %num, ptr nocapture noundef %ps) {
+; ENABLE-SHUFFLE-PADDING-LABEL: @test(
----------------
huhu233 wrote:

Hi, @david-arm, check lines for ENABLE and DISABLE are different. When the shuffle padding is enabled, the interleaved store will be transformed into `llvm.aarch64.sve.st3`.  And if the feature is disabled, there is no `sve.st3`, and I use `ISABLE-SHUFFLE-PADDING-NOT` here.

https://github.com/llvm/llvm-project/pull/75329


More information about the llvm-commits mailing list