[polly] r249269 - Make ScopAnnotator a function-local variable to ensure it is freed at each run

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 4 04:19:13 PDT 2015


Author: grosser
Date: Sun Oct  4 06:19:13 2015
New Revision: 249269

URL: http://llvm.org/viewvc/llvm-project?rev=249269&view=rev
Log:
Make ScopAnnotator a function-local variable to ensure it is freed at each run

When the ScopAnnotator was a class member variable some of the maps it contains
have not been properly cleared. As a result we had dangling pointers to
llvm::Value(s) which got detected by the AssertingVH we recently added.

No test case as this issue is hard to reproduce reliably as subsequent
optimizations need to delete some of the llvm::Values we still keep in our
lists.

Modified:
    polly/trunk/lib/CodeGen/CodeGeneration.cpp

Modified: polly/trunk/lib/CodeGen/CodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/CodeGeneration.cpp?rev=249269&r1=249268&r2=249269&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/CodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGen/CodeGeneration.cpp Sun Oct  4 06:19:13 2015
@@ -60,9 +60,6 @@ public:
   RegionInfo *RI;
   ///}
 
-  /// @brief The loop annotator to generate llvm.loop metadata.
-  ScopAnnotator Annotator;
-
   /// @brief Build the runtime condition.
   ///
   /// Build the condition that evaluates at run-time to true iff all
@@ -125,6 +122,7 @@ public:
     Region *R = &S.getRegion();
     assert(!R->isTopLevelRegion() && "Top level regions are not supported");
 
+    ScopAnnotator Annotator;
     Annotator.buildAliasScopes(S);
 
     simplifyRegion(R, DT, LI, RI);




More information about the llvm-commits mailing list