Skip to content

Commit 5892a2b

Browse files
committed
[VPlan] Remove dead code from GetBroadCastInstr (NFCI).
All relevant places should already explicitly materialize broadcasts. Remove dead code from VPTransformState::get
1 parent 6947fb4 commit 5892a2b

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -295,27 +295,11 @@ Value *VPTransformState::get(const VPValue *Def, bool NeedsScalar) {
295295
if (hasVectorValue(Def))
296296
return Data.VPV2Vector[Def];
297297

298-
auto GetBroadcastInstrs = [this, Def](Value *V) {
299-
bool SafeToHoist =
300-
!Def->hasDefiningRecipe() ||
301-
VPDT.properlyDominates(Def->getDefiningRecipe()->getParent(),
302-
Plan->getVectorPreheader());
303-
298+
auto GetBroadcastInstrs = [this](Value *V) {
304299
if (VF.isScalar())
305300
return V;
306-
// Place the code for broadcasting invariant variables in the new preheader.
307-
IRBuilder<>::InsertPointGuard Guard(Builder);
308-
if (SafeToHoist) {
309-
BasicBlock *LoopVectorPreHeader =
310-
CFG.VPBB2IRBB[Plan->getVectorPreheader()];
311-
if (LoopVectorPreHeader)
312-
Builder.SetInsertPoint(LoopVectorPreHeader->getTerminator());
313-
}
314-
315-
// Place the code for broadcasting invariant variables in the new preheader.
316301
// Broadcast the scalar into all locations in the vector.
317302
Value *Shuf = Builder.CreateVectorSplat(VF, V, "broadcast");
318-
319303
return Shuf;
320304
};
321305

0 commit comments

Comments
 (0)