[llvm] [LV][VPlan] Use VF VPValue in VPVectorPointerRecipe (PR #110974)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 04:12:14 PDT 2024


================
@@ -1813,38 +1813,59 @@ void VPWidenGEPRecipe::print(raw_ostream &O, const Twine &Indent,
 }
 #endif
 
+void VPReverseVectorPointerRecipe ::execute(VPTransformState &State) {
+  auto &Builder = State.Builder;
+  State.setDebugLocFrom(getDebugLoc());
+  unsigned CurrentPart = getUnrollPart(*this);
+  // Use i32 for the gep index type when the value is constant,
+  // or query DataLayout for a more suitable index type otherwise.
+  const DataLayout &DL = Builder.GetInsertBlock()->getDataLayout();
+  Type *IndexTy = State.VF.isScalable()
+                      ? DL.getIndexType(IndexedTy->getPointerTo())
+                      : Builder.getInt32Ty();
----------------
fhahn wrote:

Might be good to share this code between both vector pointer recipes?

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


More information about the llvm-commits mailing list