[PATCH] D95676: [VPlan][NFC] Introduce constructors for VPIteration

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 2 01:52:28 PST 2021


sdesmalen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2149
   if (Lane < UINT_MAX)
-    VectorLoopValueMap.setScalarValue(CastInst, {Part, Lane}, VectorLoopVal);
+    VectorLoopValueMap.setScalarValue(CastInst, VPIteration(Part, Lane),
+                                      VectorLoopVal);
----------------
Just an observation for this patch in isolation: Writing `{Part, Lane}` would still cause the new constructor of VPIteration to be called, so this would be an unnecessary change. But given the following patch adds another operand, using VPIteration explicitly helps clarify the code.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:104
+
+  bool isNull() const { return Part == 0 && Lane == 0; }
 };
----------------
`isFirstIteration` might be more applicable, especially given that in D95139 it also needs to look for the lane kind.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95676/new/

https://reviews.llvm.org/D95676



More information about the llvm-commits mailing list