[llvm] [VectorUtils] Add InterleaveGroup::members() (NFCI) (PR #195122)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 09:51:40 PDT 2026


================
@@ -4833,12 +4828,9 @@ void LoopVectorizationCostModel::setCostBasedWideningDecision(ElementCount VF) {
       // the cost will actually be assigned to one instruction.
       if (const auto *Group = getInterleavedAccessGroup(&I)) {
         if (Decision == CM_Scalarize) {
-          for (unsigned Idx = 0; Idx < Group->getFactor(); ++Idx) {
-            if (auto *I = Group->getMember(Idx)) {
-              setWideningDecision(I, VF, Decision,
-                                  getMemInstScalarizationCost(I, VF));
-            }
-          }
+          for (auto *I : Group->members())
----------------
artagnon wrote:

```suggestion
          for (Instruction *I : Group->members())
```

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


More information about the llvm-commits mailing list