[llvm] [LoopVectorize] Enable vectorization of uncountable loops with invariant bound loads via speculative hoisting and runtime versioning. (PR #195027)

Ashutosh Nema via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 10:42:56 PDT 2026


================
@@ -579,6 +579,123 @@ class SCEVAddRecForUniformityRewriter
 
 } // namespace
 
+static Value *stripSimpleCasts(Value *V) {
+  while (isa<SExtInst>(V) || isa<ZExtInst>(V) || isa<TruncInst>(V))
+    V = cast<Instruction>(V)->getOperand(0);
+  return V;
+}
+
+static LoadInst *getLoopBoundLoadCandidate(Loop *L) {
----------------
nema-ashutosh wrote:

This seems limited applicability as its just catering 1 load, need to extend this for a general case:
i.e. for(i=0;i<(*P1+*P2);i++)

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


More information about the llvm-commits mailing list