[llvm] a6c81d3 - [VPlan] Remove recipes from back to front.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 08:07:49 PST 2021


Author: Florian Hahn
Date: 2021-03-01T16:06:30Z
New Revision: a6c81d33667cadb713e28215f6c1f84cdaaaff64

URL: https://github.com/llvm/llvm-project/commit/a6c81d33667cadb713e28215f6c1f84cdaaaff64
DIFF: https://github.com/llvm/llvm-project/commit/a6c81d33667cadb713e28215f6c1f84cdaaaff64.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlan.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index c92c4ef82ae7..0a5abef0e1f9 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -1309,7 +1309,10 @@ class VPBasicBlock : public VPBlockBase {
       appendRecipe(Recipe);
   }
 
-  ~VPBasicBlock() override { Recipes.clear(); }
+  ~VPBasicBlock() override {
+    while (!Recipes.empty())
+      Recipes.pop_back();
+  }
 
   /// Instruction iterators...
   using iterator = RecipeListTy::iterator;


        


More information about the llvm-commits mailing list