@@ -7130,6 +7130,13 @@ void LoopVectorizationPlanner::buildVPlansWithVPRecipes(unsigned MinVF,
7130
7130
SmallPtrSet<Instruction *, 4 > DeadInstructions;
7131
7131
collectTriviallyDeadInstructions (DeadInstructions);
7132
7132
7133
+ // Add assume instructions we need to drop to DeadInstructions, to prevent
7134
+ // them from being added to the VPlan.
7135
+ // TODO: We only need to drop assumes in blocks that get flattend. If the
7136
+ // control flow is preserved, we should keep them.
7137
+ auto &ConditionalAssumes = Legal->getConditionalAssumes ();
7138
+ DeadInstructions.insert (ConditionalAssumes.begin (), ConditionalAssumes.end ());
7139
+
7133
7140
DenseMap<Instruction *, Instruction *> &SinkAfter = Legal->getSinkAfter ();
7134
7141
// Dead instructions do not need sinking. Remove them from SinkAfter.
7135
7142
for (Instruction *I : DeadInstructions)
@@ -7192,13 +7199,6 @@ VPlanPtr LoopVectorizationPlanner::buildVPlanWithVPRecipes(
7192
7199
// visit each basic block after having visited its predecessor basic blocks.
7193
7200
// ---------------------------------------------------------------------------
7194
7201
7195
- // Add assume instructions we need to drop to DeadInstructions, to prevent
7196
- // them from being added to the VPlan.
7197
- // TODO: We only need to drop assumes in blocks that get flattend. If the
7198
- // control flow is preserved, we should keep them.
7199
- auto &ConditionalAssumes = Legal->getConditionalAssumes ();
7200
- DeadInstructions.insert (ConditionalAssumes.begin (), ConditionalAssumes.end ());
7201
-
7202
7202
// Create a dummy pre-entry VPBasicBlock to start building the VPlan.
7203
7203
VPBasicBlock *VPBB = new VPBasicBlock (" Pre-Entry" );
7204
7204
auto Plan = std::make_unique<VPlan>(VPBB);
0 commit comments