[llvm] [LoopVectorize] Add support for vectorisation of more early exit loops (PR #88385)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 24 02:06:41 PDT 2024
================
@@ -653,7 +659,24 @@ class LoopAccessInfo {
bool isInvariant(Value *V) const;
unsigned getNumStores() const { return NumStores; }
- unsigned getNumLoads() const { return NumLoads;}
+ unsigned getNumLoads() const { return NumLoads; }
+ unsigned getNumCalls() const { return NumCalls; }
+
+ /// Returns all exiting blocks with a countable exit, i.e. the
+ /// exit-not-taken count is known exactly at compile time.
+ const SmallVector<BasicBlock *, 4> &getCountableExitingBlocks() const {
+ return CountableExitingBlocks;
+ }
+
+ /// Returns all the exiting blocks with an uncountable exit.
+ const SmallVector<BasicBlock *, 4> &getUncountableExitingBlocks() const {
----------------
david-arm wrote:
It could, but I'm not purely thinking about just the vectoriser. Perhaps I'm wrong, but I believe that LoopAccessAnalysis is used by other passes too, where they may also want access to this type of information? I was worried that by moving everything into LoopVectorizationLegality we may eventually end up duplicating such routines elsewhere in the codebase.
https://github.com/llvm/llvm-project/pull/88385
More information about the llvm-commits
mailing list