[PATCH] D92285: [VPlan] Manage scalarized values using VPValues.

Gil Rapaport via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 13:18:52 PST 2021


gilr added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9194
 
+  auto *RepR = dyn_cast<VPReplicateRecipe>(getOperand(0));
+  unsigned Part = State.Instance->Part;
----------------
Call `getOperand(0)->getUnderlyingValue()` directly?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9195
+  auto *RepR = dyn_cast<VPReplicateRecipe>(getOperand(0));
+  unsigned Part = State.Instance->Part;
   // By current pack/unpack logic we need to generate only a single phi node: if
----------------
Can this line be brought back under the comment to minimize the diff?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9202
   // Otherwise, a phi node for the scalar value is needed.
-  unsigned Part = State.Instance->Part;
-  Instruction *PredInst =
-      cast<Instruction>(getOperand(0)->getUnderlyingValue());
-  if (State.ValueMap.hasVectorValue(PredInst, Part)) {
-    Value *VectorValue = State.ValueMap.getVectorValue(PredInst, Part);
+  if (!State.hasVectorValue(getOperand(0), Part)) {
+    Type *PredInstType = RepR->getUnderlyingInstr()->getType();
----------------
Can the then/else logic be reversed to minimize the diff?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92285



More information about the llvm-commits mailing list