[llvm] [LoopVectorize] Teach LoopVectorizationLegality about more early exits (PR #107004)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 04:12:14 PDT 2024


================
@@ -2445,8 +2445,11 @@ bool LoopAccessInfo::analyzeLoop(AAResults *AA, const LoopInfo *LI,
       // vectorize a loop if it contains known function calls that don't set
       // the flag. Therefore, it is safe to ignore this read from memory.
       auto *Call = dyn_cast<CallInst>(&I);
-      if (Call && getVectorIntrinsicIDForCall(Call, TLI))
-        continue;
+      if (Call) {
+        NumCalls++;
----------------
david-arm wrote:

Hmm, I was probably being overly cautious here, but I'm worried about more than just stores. The function call could have side-effects, such as changing system state or generating exceptions. I might be able to relax this to permit calls to intrinsics that have no side-effects, and do not write to memory. I'll see how easy this is to do - it would require adding new tests.

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


More information about the llvm-commits mailing list