[llvm] [LoopVectorize] Teach LoopVectorizationLegality about more early exits (PR #107004)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 9 04:37:03 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++;
----------------
fhahn wrote:
I don't think we can allow any instruction that may trigger UB or a trap in the header if it would be executed unconditionally in the vectorized loop, but this should probably be checked outside of LAA, as it is irrelevant for memory dependence analysis.
https://github.com/llvm/llvm-project/pull/107004
More information about the llvm-commits
mailing list