[llvm] [LAA] Don't assume libcalls with output/input pointers can be vectorized (PR #108980)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 07:20:06 PDT 2024


================
@@ -2452,10 +2452,17 @@ bool LoopAccessInfo::analyzeLoop(AAResults *AA, const LoopInfo *LI,
       // but is not a load, then we quit. Notice that we don't handle function
       // calls that read or write.
       if (I.mayReadFromMemory()) {
-        // If the function has an explicit vectorized counterpart, we can safely
-        // assume that it can be vectorized.
+        auto hasPointerArgs = [](CallBase *CB) {
+          return llvm::any_of(CB->args(), [](Value const *Arg) {
+            return Arg->getType()->isPointerTy();
+          });
+        };
+
+        // If the function has an explicit vectorized counterpart, and does not
+        // take output/input pointers, we can safely assume that it can be
+        // vectorized.
----------------
MacDue wrote:

If this check is true it's assuming it's safe to vectorize ("and does not take output/input pointers").

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


More information about the llvm-commits mailing list