[llvm-branch-commits] [llvm] [VPlan] Model address separately. (PR #72164)

Alexey Bataev via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Nov 14 06:25:08 PST 2023


================
@@ -8231,13 +8231,24 @@ VPRecipeBase *VPRecipeBuilder::tryToWidenMemory(Instruction *I,
   bool Consecutive =
       Reverse || Decision == LoopVectorizationCostModel::CM_Widen;
 
+  VPValue *Ptr = isa<LoadInst>(I) ? Operands[0] : Operands[1];
+  if (Decision != LoopVectorizationCostModel::CM_GatherScatter &&
+      Decision != LoopVectorizationCostModel::CM_Interleave) {
+    auto *VectorPtr = Reverse
+                          ? new VPInstruction(VPInstruction::CreateVectorPtr,
+                                              {Ptr, Ptr}, I->getDebugLoc())
----------------
alexey-bataev wrote:

I think better to add some kind of bool flag for reverse rather than mimic it with unused operand. Can you make it?

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


More information about the llvm-branch-commits mailing list