[llvm] f8fa931 - [LV] Add VPBuilder::insert, use to insert created vector pointer (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 3 14:22:39 PST 2025
Author: Florian Hahn
Date: 2025-02-03T22:20:40Z
New Revision: f8fa93193b664c33c9227073b2bd123842e05ffc
URL: https://github.com/llvm/llvm-project/commit/f8fa93193b664c33c9227073b2bd123842e05ffc
DIFF: https://github.com/llvm/llvm-project/commit/f8fa93193b664c33c9227073b2bd123842e05ffc.diff
LOG: [LV] Add VPBuilder::insert, use to insert created vector pointer (NFC).
Split off from https://github.com/llvm/llvm-project/pull/124432 as
suggested. Adds VPBuilder::insert, inspired by IRBuilderBase.
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
index fc10a518d39ef8..ed3e45dd2c6c84 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
@@ -141,6 +141,9 @@ class VPBuilder {
InsertPt = IP->getIterator();
}
+ /// Insert \p R at the current insertion point.
+ void insert(VPRecipeBase *R) { BB->insert(R, InsertPt); }
+
/// Create an N-ary operation with \p Opcode, \p Operands and set \p Inst as
/// its underlying Instruction.
VPInstruction *createNaryOp(unsigned Opcode, ArrayRef<VPValue *> Operands,
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index ce66350669d50f..660a6ef574576b 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -8323,7 +8323,7 @@ VPRecipeBuilder::tryToWidenMemory(Instruction *I, ArrayRef<VPValue *> Operands,
: GEPNoWrapFlags::none(),
I->getDebugLoc());
}
- Builder.getInsertBlock()->appendRecipe(VectorPtr);
+ Builder.insert(VectorPtr);
Ptr = VectorPtr;
}
if (LoadInst *Load = dyn_cast<LoadInst>(I))
More information about the llvm-commits
mailing list