[llvm] d27b4b6 - [LV][NFC] Add another case to cast-costs.ll test (#201117)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 02:49:00 PDT 2026


Author: David Sherwood
Date: 2026-06-03T10:48:56+01:00
New Revision: d27b4b6c1c15d3e99d35749cefcf296500b0944e

URL: https://github.com/llvm/llvm-project/commit/d27b4b6c1c15d3e99d35749cefcf296500b0944e
DIFF: https://github.com/llvm/llvm-project/commit/d27b4b6c1c15d3e99d35749cefcf296500b0944e.diff

LOG: [LV][NFC] Add another case to cast-costs.ll test (#201117)

Added: 
    

Modified: 
    llvm/test/Transforms/LoopVectorize/cast-costs.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/LoopVectorize/cast-costs.ll b/llvm/test/Transforms/LoopVectorize/cast-costs.ll
index 14b3e71b39166..4020807988635 100644
--- a/llvm/test/Transforms/LoopVectorize/cast-costs.ll
+++ b/llvm/test/Transforms/LoopVectorize/cast-costs.ll
@@ -1,6 +1,6 @@
-; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost.*EMIT-SCALAR.*(trunc|sext|zext)" --filter "Cost.*WIDEN-CAST" --filter-out-after "LV: Selecting VF" --version 6
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --filter "Cost.*(EMIT-SCALAR|CLONE).*(trunc|sext|zext)" --filter "Cost.*WIDEN-CAST" --filter-out-after "LV: Selecting VF" --version 6
 ; REQUIRES: asserts
-; RUN: opt -p loop-vectorize -S -disable-output -debug-only=loop-vectorize %s 2>&1 | FileCheck %s
+; RUN: opt -p loop-vectorize -force-target-supports-scalable-vectors -S -disable-output -debug-only=loop-vectorize %s 2>&1 | FileCheck %s
 
 define void @trunc_store(ptr %dst) {
 ; CHECK-LABEL: 'trunc_store'
@@ -78,3 +78,26 @@ exit:
   %ret = trunc i32 %red.next to i8
   ret i8 %ret
 }
+
+define void @replicate_zext(ptr %A, i32 %n) {
+; CHECK-LABEL: 'replicate_zext'
+; CHECK:  Cost of 1 for VF vscale x 1: CLONE ir<%iv.ext> = zext vp<[[VP4:%[0-9]+]]>
+;
+entry:
+  br label %loop
+
+loop:
+  %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
+  %iv.ext = zext i32 %iv to i64
+  %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv.ext
+  store i32 0, ptr %gep.A, align 4
+  %cmp = icmp ne i32 %iv, 1000
+  %iv.next = add nsw i32 %iv, 1
+  br i1 %cmp, label %loop, label %exit, !llvm.loop !0
+
+exit:
+  ret void
+}
+
+!0 = distinct !{!0, !1}
+!1 = !{!"llvm.loop.vectorize.scalable.enable", i1 true}


        


More information about the llvm-commits mailing list