[VPlan] Remove recipes from back to front.

Update the deletion order when destroying VPBasicBlocks. This ensures
recipes that depend on earlier ones in the block are removed first.
Otherwise this may cause issues when recipes have remaining users later
in the block.
This commit is contained in:
Florian Hahn 2021-03-01 16:04:37 +00:00
parent 2632ba6a35
commit a6c81d3366
No known key found for this signature in database
GPG Key ID: 61D7554B5CECDC0D
1 changed files with 4 additions and 1 deletions

View File

@ -1309,7 +1309,10 @@ public:
appendRecipe(Recipe);
}
~VPBasicBlock() override { Recipes.clear(); }
~VPBasicBlock() override {
while (!Recipes.empty())
Recipes.pop_back();
}
/// Instruction iterators...
using iterator = RecipeListTy::iterator;