[llvm] [LV][NFC] Add another case to cast-costs.ll test (PR #201117)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 2 06:20:57 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: David Sherwood (david-arm)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/201117.diff
1 Files Affected:
- (modified) llvm/test/Transforms/LoopVectorize/cast-costs.ll (+30-2)
``````````diff
diff --git a/llvm/test/Transforms/LoopVectorize/cast-costs.ll b/llvm/test/Transforms/LoopVectorize/cast-costs.ll
index 14b3e71b39166..6d2f534e43bbf 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,31 @@ exit:
%ret = trunc i32 %red.next to i8
ret i8 %ret
}
+
+define void @replicate_zext(ptr nocapture noundef writeonly %A, ptr nocapture noundef readonly %B, i32 noundef signext %n) {
+; CHECK-LABEL: 'replicate_zext'
+; CHECK: Cost of 1 for VF vscale x 1: CLONE ir<%idxprom> = zext ir<%i.0>
+;
+entry:
+ br label %for.body
+
+for.body:
+ %indvars.iv = phi i32 [ %n, %entry ], [ %indvars.iv.next, %for.body ]
+ %i.0.in8 = phi i32 [ %n, %entry ], [ %i.0, %for.body ]
+ %i.0 = add nsw i32 %i.0.in8, -1
+ %idxprom = zext i32 %i.0 to i64
+ %arrayidx = getelementptr inbounds i32, ptr %B, i64 %idxprom
+ %1 = load i32, ptr %arrayidx, align 4
+ %add9 = add i32 %1, 1
+ %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom
+ store i32 %add9, ptr %arrayidx3, align 4
+ %cmp = icmp ugt i32 %indvars.iv, 1
+ %indvars.iv.next = add nsw i32 %indvars.iv, -1
+ br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !0
+
+for.cond.cleanup:
+ ret void
+}
+
+!0 = distinct !{!0, !1}
+!1 = !{!"llvm.loop.vectorize.scalable.enable", i1 true}
``````````
</details>
https://github.com/llvm/llvm-project/pull/201117
More information about the llvm-commits
mailing list