[llvm] llvm: honor VFABI mappings without builtin suppression (PR #193884)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 08:23:21 PDT 2026


https://github.com/wpcwzy updated https://github.com/llvm/llvm-project/pull/193884

>From a068c40e45156f37ed35cdbe91a61503200df92d Mon Sep 17 00:00:00 2001
From: Pincheng Wang <pincheng.plct at isrc.iscas.ac.cn>
Date: Wed, 22 Apr 2026 22:32:01 +0800
Subject: [PATCH 1/4] llvm: honor VFABI mappings without builtin suppression

---
 llvm/lib/Analysis/LoopAccessAnalysis.cpp      |  7 +--
 llvm/lib/IR/VFABIDemangler.cpp                |  6 ++-
 .../Scalar/WarnMissedTransforms.cpp           | 48 +++++++++--------
 .../Transforms/Vectorize/LoopVectorize.cpp    |  2 +-
 ...p-simd-vectorization-remarks-suppressed.ll | 30 +++++++++++
 .../LoopVectorize/no-builtin-vfabi.ll         | 51 +++++++++++++++++++
 6 files changed, 118 insertions(+), 26 deletions(-)
 create mode 100644 llvm/test/Transforms/LoopTransformWarning/omp-simd-vectorization-remarks-suppressed.ll
 create mode 100644 llvm/test/Transforms/LoopVectorize/no-builtin-vfabi.ll

diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 5d88e5f54e3d6..15eee6fc2054c 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -2575,9 +2575,10 @@ bool LoopAccessInfo::analyzeLoop(AAResults *AA, const LoopInfo *LI,
 
         // If the function has an explicit vectorized counterpart, and does not
         // take output/input pointers, we can safely assume that it can be
-        // vectorized.
-        if (Call && !Call->isNoBuiltin() && Call->getCalledFunction() &&
-            !hasPointerArgs(Call) && !VFDatabase::getMappings(*Call).empty())
+        // vectorized. This remains valid even when the scalar call is marked
+        // no-builtin, because the explicit mapping supplies the vector variant.
+        if (Call && Call->getCalledFunction() && !hasPointerArgs(Call) &&
+            !VFDatabase::getMappings(*Call).empty())
           continue;
 
         auto *Ld = dyn_cast<LoadInst>(&I);
diff --git a/llvm/lib/IR/VFABIDemangler.cpp b/llvm/lib/IR/VFABIDemangler.cpp
index 4fcf43616d60c..ab213d3034446 100644
--- a/llvm/lib/IR/VFABIDemangler.cpp
+++ b/llvm/lib/IR/VFABIDemangler.cpp
@@ -534,7 +534,11 @@ VFParamKind VFABI::getVFParamKindFromString(const StringRef Token) {
 
 void VFABI::getVectorVariantNames(
     const CallInst &CI, SmallVectorImpl<std::string> &VariantMappings) {
-  const StringRef S = CI.getFnAttr(VFABI::MappingsAttrName).getValueAsString();
+  StringRef S = CI.getFnAttr(VFABI::MappingsAttrName).getValueAsString();
+  if (S.empty()) {
+    if (const Function *F = CI.getCalledFunction())
+      S = F->getFnAttribute(VFABI::MappingsAttrName).getValueAsString();
+  }
   if (S.empty())
     return;
 
diff --git a/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp b/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
index e53019768e881..a56459842914c 100644
--- a/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
+++ b/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
@@ -46,28 +46,34 @@ static void warnAboutLeftoverTransformations(Loop *L,
   }
 
   if (hasVectorizeTransformation(L) == TM_ForcedByUser) {
-    LLVM_DEBUG(dbgs() << "Leftover vectorization transformation\n");
-    std::optional<ElementCount> VectorizeWidth =
-        getOptionalElementCountLoopAttribute(L);
-    std::optional<int> InterleaveCount =
-        getOptionalIntLoopAttribute(L, "llvm.loop.interleave.count");
+    // OpenMP SIMD loops are represented as annotated parallel loops.  They can
+    // still legally execute without loop-vectorization, so avoid turning these
+    // cases into transform-warning diagnostics that are commonly promoted to
+    // hard errors by -Werror builds.
+    if (!L->isAnnotatedParallel()) {
+      LLVM_DEBUG(dbgs() << "Leftover vectorization transformation\n");
+      std::optional<ElementCount> VectorizeWidth =
+          getOptionalElementCountLoopAttribute(L);
+      std::optional<int> InterleaveCount =
+          getOptionalIntLoopAttribute(L, "llvm.loop.interleave.count");
 
-    if (!VectorizeWidth || VectorizeWidth->isVector())
-      ORE->emit(
-          DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
-                                            "FailedRequestedVectorization",
-                                            L->getStartLoc(), L->getHeader())
-          << "loop not vectorized: the optimizer was unable to perform the "
-             "requested transformation; the transformation might be disabled "
-             "or specified as part of an unsupported transformation ordering");
-    else if (InterleaveCount.value_or(0) != 1)
-      ORE->emit(
-          DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
-                                            "FailedRequestedInterleaving",
-                                            L->getStartLoc(), L->getHeader())
-          << "loop not interleaved: the optimizer was unable to perform the "
-             "requested transformation; the transformation might be disabled "
-             "or specified as part of an unsupported transformation ordering");
+      if (!VectorizeWidth || VectorizeWidth->isVector())
+        ORE->emit(
+            DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
+                                              "FailedRequestedVectorization",
+                                              L->getStartLoc(), L->getHeader())
+            << "loop not vectorized: the optimizer was unable to perform the "
+               "requested transformation; the transformation might be disabled "
+               "or specified as part of an unsupported transformation ordering");
+      else if (InterleaveCount.value_or(0) != 1)
+        ORE->emit(
+            DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
+                                              "FailedRequestedInterleaving",
+                                              L->getStartLoc(), L->getHeader())
+            << "loop not interleaved: the optimizer was unable to perform the "
+               "requested transformation; the transformation might be disabled "
+               "or specified as part of an unsupported transformation ordering");
+    }
   }
 
   if (hasDistributeTransformation(L) == TM_ForcedByUser) {
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index a63956c0cba6b..c2097691e45b9 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5963,7 +5963,7 @@ void LoopVectorizationCostModel::setVectorizedCallDecision(ElementCount VF) {
         break;
       }
 
-      if (TLI && VecFunc && !CI->isNoBuiltin())
+      if (VecFunc)
         VectorCost = TTI.getCallInstrCost(nullptr, RetTy, Tys, CostKind);
 
       // Find the cost of an intrinsic; some targets may have instructions that
diff --git a/llvm/test/Transforms/LoopTransformWarning/omp-simd-vectorization-remarks-suppressed.ll b/llvm/test/Transforms/LoopTransformWarning/omp-simd-vectorization-remarks-suppressed.ll
new file mode 100644
index 0000000000000..6f7773ac034ae
--- /dev/null
+++ b/llvm/test/Transforms/LoopTransformWarning/omp-simd-vectorization-remarks-suppressed.ll
@@ -0,0 +1,30 @@
+; RUN: opt -passes=transform-warning -disable-output -pass-remarks-missed=transform-warning -pass-remarks-analysis=transform-warning < %s 2>&1 | FileCheck -allow-empty %s
+;
+; OpenMP SIMD loops are represented as annotated parallel loops. Keep
+; transform-warning from emitting FailedRequestedVectorization for these loops.
+;
+; CHECK-NOT: FailedRequestedVectorization
+; CHECK-NOT: loop not vectorized
+
+define void @test(ptr %x, ptr %c) {
+entry:
+  br label %loop
+
+loop:
+  %i = phi i64 [ 0, %entry ], [ %next, %loop ]
+  %src.ptr = getelementptr inbounds double, ptr %c, i64 %i
+  %v = load double, ptr %src.ptr, align 8, !llvm.access.group !1
+  %dst.ptr = getelementptr inbounds double, ptr %x, i64 %i
+  store double %v, ptr %dst.ptr, align 8, !llvm.access.group !1
+  %next = add nuw nsw i64 %i, 1
+  %done = icmp eq i64 %next, 64
+  br i1 %done, label %exit, label %loop, !llvm.loop !0
+
+exit:
+  ret void
+}
+
+!0 = distinct !{!0, !2, !3}
+!1 = distinct !{}
+!2 = !{!"llvm.loop.vectorize.enable", i1 true}
+!3 = !{!"llvm.loop.parallel_accesses", !1}
diff --git a/llvm/test/Transforms/LoopVectorize/no-builtin-vfabi.ll b/llvm/test/Transforms/LoopVectorize/no-builtin-vfabi.ll
new file mode 100644
index 0000000000000..78d843f5b0e0d
--- /dev/null
+++ b/llvm/test/Transforms/LoopVectorize/no-builtin-vfabi.ll
@@ -0,0 +1,51 @@
+; RUN: opt -passes=loop-vectorize -S < %s | FileCheck %s
+
+; NOTE: This is a focused reproducer for OpenMP declare-simd style VFABI mapping.
+
+target triple = "x86_64-unknown-linux-gnu"
+
+define i32 @test_vector_abi() local_unnamed_addr #0 {
+entry:
+  br label %loop
+
+loop:
+  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
+  %src = getelementptr inbounds nuw double, ptr @c, i64 %iv
+  %v = load double, ptr %src, align 8, !tbaa !4, !llvm.access.group !8
+  %r = tail call double @acosh(double noundef %v) #2, !llvm.access.group !8
+  %dst = getelementptr inbounds nuw double, ptr @x, i64 %iv
+  store double %r, ptr %dst, align 8, !tbaa !4, !llvm.access.group !8
+  %iv.next = add nuw nsw i64 %iv, 1
+  %done = icmp eq i64 %iv.next, 1000
+  br i1 %done, label %exit, label %loop, !llvm.loop !9
+
+exit:
+  ret i32 0
+}
+
+ at x = dso_local local_unnamed_addr global [1000 x double] zeroinitializer, align 16
+ at c = dso_local local_unnamed_addr global [1000 x double] zeroinitializer, align 16
+
+; CHECK-LABEL: @test_vector_abi(
+; CHECK: vector.body:
+; CHECK: call <2 x double> @_ZGVbN2v_acosh
+
+declare double @acosh(double noundef) local_unnamed_addr #1
+
+declare <2 x double> @_ZGVbN2v_acosh(<2 x double>)
+declare <4 x double> @_ZGVcN4v_acosh(<4 x double>)
+declare <4 x double> @_ZGVdN4v_acosh(<4 x double>)
+declare <8 x double> @_ZGVeN8v_acosh(<8 x double>)
+
+attributes #0 = { noinline nounwind strictfp }
+attributes #1 = { nounwind "_ZGVbN2v_acosh" "_ZGVcN4v_acosh" "_ZGVdN4v_acosh" "_ZGVeN8v_acosh" "no-builtins" "vector-function-abi-variant"="_ZGVbN2v_acosh,_ZGVcN4v_acosh,_ZGVdN4v_acosh,_ZGVeN8v_acosh" }
+attributes #2 = { nobuiltin nounwind strictfp "no-builtins" }
+
+!4 = !{!5, !5, i64 0}
+!5 = !{!"double", !6, i64 0}
+!6 = !{!"omnipotent char", !7, i64 0}
+!7 = !{!"Simple C/C++ TBAA"}
+!8 = distinct !{}
+!9 = distinct !{!9, !10, !11}
+!10 = !{!"llvm.loop.parallel_accesses", !8}
+!11 = !{!"llvm.loop.vectorize.enable", i1 true}

>From 1a99c79ad0ea5d72f39afa5a185f1aa05ef894af Mon Sep 17 00:00:00 2001
From: Pincheng Wang <pincheng.plct at isrc.iscas.ac.cn>
Date: Thu, 4 Jun 2026 22:12:23 +0800
Subject: [PATCH 2/4] [LAA] Drop redundant clarification on VFABI counterpart
 fast path

The two extra comment lines added on top of the existing description do
not say anything that is not already obvious from the surrounding
condition. Restore the shorter wording so future readers do not have to
puzzle over the no-builtin disclaimer.
---
 llvm/lib/Analysis/LoopAccessAnalysis.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 15eee6fc2054c..c0b08d113bcee 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -2575,8 +2575,7 @@ bool LoopAccessInfo::analyzeLoop(AAResults *AA, const LoopInfo *LI,
 
         // If the function has an explicit vectorized counterpart, and does not
         // take output/input pointers, we can safely assume that it can be
-        // vectorized. This remains valid even when the scalar call is marked
-        // no-builtin, because the explicit mapping supplies the vector variant.
+        // vectorized.
         if (Call && Call->getCalledFunction() && !hasPointerArgs(Call) &&
             !VFDatabase::getMappings(*Call).empty())
           continue;

>From 9e5da4d50090d1c90fa76c380e07a9827eb3990b Mon Sep 17 00:00:00 2001
From: Pincheng Wang <pincheng.plct at isrc.iscas.ac.cn>
Date: Thu, 4 Jun 2026 23:22:34 +0800
Subject: [PATCH 3/4] [LoopVectorize] Make the no-builtin VFABI regression test
 minimal and target-agnostic

The test currently leans on the x86_64 cost model picking a specific VF
for acosh, uses four x86-specific variant mappings, and stores its
inputs in globals decorated with TBAA / access-group metadata. None of
that is needed to exercise VFABI mapping discovery on a no-builtin call.

Force the VF on the RUN line, drop the explicit triple so the test
matches the rest of llvm/test/Transforms/LoopVectorize, take the source
and destination buffers as parameters (noalias on the writable one),
and use a single _ZGV_LLVM_N2v_acosh(vector_acosh) mapping. Also attach
memory(inaccessiblemem: read) to acosh to mirror the attribute clang
puts on libm calls in OpenMP mode.
---
 .../LoopVectorize/no-builtin-vfabi.ll         | 48 +++++++------------
 1 file changed, 17 insertions(+), 31 deletions(-)

diff --git a/llvm/test/Transforms/LoopVectorize/no-builtin-vfabi.ll b/llvm/test/Transforms/LoopVectorize/no-builtin-vfabi.ll
index 78d843f5b0e0d..41c2f46b9de65 100644
--- a/llvm/test/Transforms/LoopVectorize/no-builtin-vfabi.ll
+++ b/llvm/test/Transforms/LoopVectorize/no-builtin-vfabi.ll
@@ -1,51 +1,37 @@
-; RUN: opt -passes=loop-vectorize -S < %s | FileCheck %s
+; RUN: opt -passes=loop-vectorize -force-vector-width=2 -S < %s | FileCheck %s
 
 ; NOTE: This is a focused reproducer for OpenMP declare-simd style VFABI mapping.
 
-target triple = "x86_64-unknown-linux-gnu"
-
-define i32 @test_vector_abi() local_unnamed_addr #0 {
+define void @test_vector_abi(ptr noalias %x, ptr %c) #0 {
 entry:
   br label %loop
 
 loop:
   %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
-  %src = getelementptr inbounds nuw double, ptr @c, i64 %iv
-  %v = load double, ptr %src, align 8, !tbaa !4, !llvm.access.group !8
-  %r = tail call double @acosh(double noundef %v) #2, !llvm.access.group !8
-  %dst = getelementptr inbounds nuw double, ptr @x, i64 %iv
-  store double %r, ptr %dst, align 8, !tbaa !4, !llvm.access.group !8
+  %src = getelementptr inbounds double, ptr %c, i64 %iv
+  %v = load double, ptr %src, align 8
+  %r = tail call double @acosh(double noundef %v) #2
+  %dst = getelementptr inbounds double, ptr %x, i64 %iv
+  store double %r, ptr %dst, align 8
   %iv.next = add nuw nsw i64 %iv, 1
   %done = icmp eq i64 %iv.next, 1000
-  br i1 %done, label %exit, label %loop, !llvm.loop !9
+  br i1 %done, label %exit, label %loop, !llvm.loop !0
 
 exit:
-  ret i32 0
+  ret void
 }
 
- at x = dso_local local_unnamed_addr global [1000 x double] zeroinitializer, align 16
- at c = dso_local local_unnamed_addr global [1000 x double] zeroinitializer, align 16
-
 ; CHECK-LABEL: @test_vector_abi(
 ; CHECK: vector.body:
-; CHECK: call <2 x double> @_ZGVbN2v_acosh
+; CHECK: call <2 x double> @vector_acosh
 
-declare double @acosh(double noundef) local_unnamed_addr #1
+declare double @acosh(double noundef) #1
 
-declare <2 x double> @_ZGVbN2v_acosh(<2 x double>)
-declare <4 x double> @_ZGVcN4v_acosh(<4 x double>)
-declare <4 x double> @_ZGVdN4v_acosh(<4 x double>)
-declare <8 x double> @_ZGVeN8v_acosh(<8 x double>)
+declare <2 x double> @vector_acosh(<2 x double>)
 
 attributes #0 = { noinline nounwind strictfp }
-attributes #1 = { nounwind "_ZGVbN2v_acosh" "_ZGVcN4v_acosh" "_ZGVdN4v_acosh" "_ZGVeN8v_acosh" "no-builtins" "vector-function-abi-variant"="_ZGVbN2v_acosh,_ZGVcN4v_acosh,_ZGVdN4v_acosh,_ZGVeN8v_acosh" }
-attributes #2 = { nobuiltin nounwind strictfp "no-builtins" }
-
-!4 = !{!5, !5, i64 0}
-!5 = !{!"double", !6, i64 0}
-!6 = !{!"omnipotent char", !7, i64 0}
-!7 = !{!"Simple C/C++ TBAA"}
-!8 = distinct !{}
-!9 = distinct !{!9, !10, !11}
-!10 = !{!"llvm.loop.parallel_accesses", !8}
-!11 = !{!"llvm.loop.vectorize.enable", i1 true}
+attributes #1 = { nounwind memory(inaccessiblemem: read) "_ZGV_LLVM_N2v_acosh" "no-builtins" "vector-function-abi-variant"="_ZGV_LLVM_N2v_acosh(vector_acosh)" }
+attributes #2 = { nobuiltin nounwind strictfp memory(inaccessiblemem: read) "no-builtins" }
+
+!0 = distinct !{!0, !1}
+!1 = !{!"llvm.loop.vectorize.enable", i1 true}

>From 90c2eb3855d6a8f093cf636d61868481be1be384 Mon Sep 17 00:00:00 2001
From: Pincheng Wang <pincheng.plct at isrc.iscas.ac.cn>
Date: Thu, 4 Jun 2026 22:13:33 +0800
Subject: [PATCH 4/4] [Transforms][LoopTransformWarning] Drop OpenMP
 parallel-loop suppression hunks

Remove the FailedRequestedVectorization / FailedRequestedInterleaving
skip path that was introduced earlier in this branch for loops carrying
llvm.loop.parallel_accesses, along with its lit test. The suppression
addresses an orthogonal concern from the VFABI mapping handling that
the rest of this branch covers, and is tracked on its own elsewhere.

This restores WarnMissedTransforms.cpp to its upstream behaviour.
---
 .../Scalar/WarnMissedTransforms.cpp           | 48 ++++++++-----------
 ...p-simd-vectorization-remarks-suppressed.ll | 30 ------------
 2 files changed, 21 insertions(+), 57 deletions(-)
 delete mode 100644 llvm/test/Transforms/LoopTransformWarning/omp-simd-vectorization-remarks-suppressed.ll

diff --git a/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp b/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
index a56459842914c..e53019768e881 100644
--- a/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
+++ b/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
@@ -46,34 +46,28 @@ static void warnAboutLeftoverTransformations(Loop *L,
   }
 
   if (hasVectorizeTransformation(L) == TM_ForcedByUser) {
-    // OpenMP SIMD loops are represented as annotated parallel loops.  They can
-    // still legally execute without loop-vectorization, so avoid turning these
-    // cases into transform-warning diagnostics that are commonly promoted to
-    // hard errors by -Werror builds.
-    if (!L->isAnnotatedParallel()) {
-      LLVM_DEBUG(dbgs() << "Leftover vectorization transformation\n");
-      std::optional<ElementCount> VectorizeWidth =
-          getOptionalElementCountLoopAttribute(L);
-      std::optional<int> InterleaveCount =
-          getOptionalIntLoopAttribute(L, "llvm.loop.interleave.count");
+    LLVM_DEBUG(dbgs() << "Leftover vectorization transformation\n");
+    std::optional<ElementCount> VectorizeWidth =
+        getOptionalElementCountLoopAttribute(L);
+    std::optional<int> InterleaveCount =
+        getOptionalIntLoopAttribute(L, "llvm.loop.interleave.count");
 
-      if (!VectorizeWidth || VectorizeWidth->isVector())
-        ORE->emit(
-            DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
-                                              "FailedRequestedVectorization",
-                                              L->getStartLoc(), L->getHeader())
-            << "loop not vectorized: the optimizer was unable to perform the "
-               "requested transformation; the transformation might be disabled "
-               "or specified as part of an unsupported transformation ordering");
-      else if (InterleaveCount.value_or(0) != 1)
-        ORE->emit(
-            DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
-                                              "FailedRequestedInterleaving",
-                                              L->getStartLoc(), L->getHeader())
-            << "loop not interleaved: the optimizer was unable to perform the "
-               "requested transformation; the transformation might be disabled "
-               "or specified as part of an unsupported transformation ordering");
-    }
+    if (!VectorizeWidth || VectorizeWidth->isVector())
+      ORE->emit(
+          DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
+                                            "FailedRequestedVectorization",
+                                            L->getStartLoc(), L->getHeader())
+          << "loop not vectorized: the optimizer was unable to perform the "
+             "requested transformation; the transformation might be disabled "
+             "or specified as part of an unsupported transformation ordering");
+    else if (InterleaveCount.value_or(0) != 1)
+      ORE->emit(
+          DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
+                                            "FailedRequestedInterleaving",
+                                            L->getStartLoc(), L->getHeader())
+          << "loop not interleaved: the optimizer was unable to perform the "
+             "requested transformation; the transformation might be disabled "
+             "or specified as part of an unsupported transformation ordering");
   }
 
   if (hasDistributeTransformation(L) == TM_ForcedByUser) {
diff --git a/llvm/test/Transforms/LoopTransformWarning/omp-simd-vectorization-remarks-suppressed.ll b/llvm/test/Transforms/LoopTransformWarning/omp-simd-vectorization-remarks-suppressed.ll
deleted file mode 100644
index 6f7773ac034ae..0000000000000
--- a/llvm/test/Transforms/LoopTransformWarning/omp-simd-vectorization-remarks-suppressed.ll
+++ /dev/null
@@ -1,30 +0,0 @@
-; RUN: opt -passes=transform-warning -disable-output -pass-remarks-missed=transform-warning -pass-remarks-analysis=transform-warning < %s 2>&1 | FileCheck -allow-empty %s
-;
-; OpenMP SIMD loops are represented as annotated parallel loops. Keep
-; transform-warning from emitting FailedRequestedVectorization for these loops.
-;
-; CHECK-NOT: FailedRequestedVectorization
-; CHECK-NOT: loop not vectorized
-
-define void @test(ptr %x, ptr %c) {
-entry:
-  br label %loop
-
-loop:
-  %i = phi i64 [ 0, %entry ], [ %next, %loop ]
-  %src.ptr = getelementptr inbounds double, ptr %c, i64 %i
-  %v = load double, ptr %src.ptr, align 8, !llvm.access.group !1
-  %dst.ptr = getelementptr inbounds double, ptr %x, i64 %i
-  store double %v, ptr %dst.ptr, align 8, !llvm.access.group !1
-  %next = add nuw nsw i64 %i, 1
-  %done = icmp eq i64 %next, 64
-  br i1 %done, label %exit, label %loop, !llvm.loop !0
-
-exit:
-  ret void
-}
-
-!0 = distinct !{!0, !2, !3}
-!1 = distinct !{}
-!2 = !{!"llvm.loop.vectorize.enable", i1 true}
-!3 = !{!"llvm.loop.parallel_accesses", !1}



More information about the llvm-commits mailing list