[VPlan] Remove dead code from GetBroadCastInstr (NFCI).

All relevant places should already explicitly materialize broadcasts.
Remove dead code from VPTransformState::get
This commit is contained in:
Florian Hahn 2025-08-17 21:51:13 +01:00
parent 6947fb4556
commit 5892a2beec
No known key found for this signature in database
GPG Key ID: C8B0D7090F9127E6

View File

@ -295,27 +295,11 @@ Value *VPTransformState::get(const VPValue *Def, bool NeedsScalar) {
if (hasVectorValue(Def))
return Data.VPV2Vector[Def];
auto GetBroadcastInstrs = [this, Def](Value *V) {
bool SafeToHoist =
!Def->hasDefiningRecipe() ||
VPDT.properlyDominates(Def->getDefiningRecipe()->getParent(),
Plan->getVectorPreheader());
auto GetBroadcastInstrs = [this](Value *V) {
if (VF.isScalar())
return V;
// Place the code for broadcasting invariant variables in the new preheader.
IRBuilder<>::InsertPointGuard Guard(Builder);
if (SafeToHoist) {
BasicBlock *LoopVectorPreHeader =
CFG.VPBB2IRBB[Plan->getVectorPreheader()];
if (LoopVectorPreHeader)
Builder.SetInsertPoint(LoopVectorPreHeader->getTerminator());
}
// Place the code for broadcasting invariant variables in the new preheader.
// Broadcast the scalar into all locations in the vector.
Value *Shuf = Builder.CreateVectorSplat(VF, V, "broadcast");
return Shuf;
};