[llvm] 147a561 - [VPlan] Clean up preheader block after b85a402dd899fc.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 08:30:16 PDT 2023


Author: Florian Hahn
Date: 2023-05-04T16:29:57+01:00
New Revision: 147a56149c54d802d642350cd091bdcb0a752f4d

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

LOG: [VPlan] Clean up preheader block after b85a402dd899fc.

Fix a leak introduced in b85a402dd899fc and flagged by LSan
https://lab.llvm.org/buildbot#builders/5/builds/33452

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index a534b986055e..23646901b396 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -591,6 +591,9 @@ VPlan::~VPlan() {
       Block->dropAllReferences(&DummyValue);
 
     VPBlockBase::deleteCFG(Entry);
+
+    Preheader->dropAllReferences(&DummyValue);
+    delete Preheader;
   }
   for (VPValue *VPV : VPLiveInsToFree)
     delete VPV;


        


More information about the llvm-commits mailing list