[llvm] [LV] Introduce -force-target-supports-gather-scatter-ops testing option (PR #196947)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Wed May 13 05:14:56 PDT 2026
=?utf-8?q?Gaƫtan?= Bossu <gaetan.bossu at arm.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/196947 at github.com>
================
@@ -0,0 +1,48 @@
+; RUN: opt -passes=loop-vectorize -force-vector-width=4 -force-target-supports-gather-scatter-ops=true \
+; RUN: -S < %s | FileCheck %s --check-prefixes=CHECK,GATHER-SCATTER-ENABLED
+; RUN: opt -passes=loop-vectorize -force-vector-width=4 -force-target-supports-gather-scatter-ops=false \
+; RUN: -S < %s | FileCheck %s --check-prefixes=CHECK,GATHER-SCATTER-DISABLED
+
+; Generic test using for the force-target-supports-gather-scatter-ops option.
+
+define void @gather_i32(ptr noalias nocapture readonly %a, ptr noalias nocapture readonly %b, ptr noalias nocapture %c, i64 %n) {
+; CHECK-LABEL: define void @gather_i32(
+; GATHER-SCATTER-ENABLED: call <4 x float> @llvm.masked.gather.v4f32
+; GATHER-SCATTER-DISABLED-NOT: @llvm.masked.gather
+entry:
+ br label %for.body
+for.body:
----------------
david-arm wrote:
nit: Can you put a newline between blocks in these tests?
https://github.com/llvm/llvm-project/pull/196947
More information about the llvm-commits
mailing list