[llvm] [LV] Vectorize bounded (i % 2^N) loads in read only loops w/o RT checks. (PR #207279)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 08:33:28 PDT 2026


================
@@ -5384,6 +5405,9 @@ void VPlanTransforms::makeMemOpWideningDecisions(VPlan &Plan, VFRange &Range,
 
   // Few helpers to process different kinds of memory operations.
 
+  bool LoopHasStore = any_of(
+      MemOps, [](VPInstruction *VPI) { return VPI->mayWriteToMemory(); });
----------------
artagnon wrote:

```suggestion
  bool LoopHasStore = any_of(
      MemOps, match_fn(m_VPInstruction<Instruction::Store>()));
```

I don't think we need to pull in mayWriteToMemory? Alternatively, we could initialize the boolean in the loop above where we're already checking this?

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


More information about the llvm-commits mailing list