[llvm] Adding the support for vectorization of loops with load based tripcount (PR #209390)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 01:49:51 PDT 2026


================
@@ -0,0 +1,144 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt < %s -passes=loop-vectorize -enable-vectorize-loads-as-bound -force-vector-width=4 -force-vector-interleave=1 -S | FileCheck %s
+;
+; Simple loop with loop bound loaded from a pointer (*Len).
+;
+;   void foo(int *A, int *B, int *C, int *Len) {
+;     for (int i = 0; i < *Len; i++)
+;       A[i] = B[i] + C[i];
+;   }
+;
+
+define dso_local void @foo(ptr noundef writeonly captures(none) %A, ptr noundef readonly captures(none) %B, ptr noundef readonly captures(none) %C, ptr noundef readonly captures(none) %Len) #0 {
----------------
artagnon wrote:

```suggestion
define void @foo(ptr %A, ptr %B, ptr %C, ptr %Len) #0 {
```

Similarly in other tests?

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


More information about the llvm-commits mailing list