[llvm] 92ce943 - Revert "[Attributor][FIX] Try to prevent a potential memory leak"

Mitch Phillips via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 17:57:31 PST 2022


Author: Mitch Phillips
Date: 2022-12-16T17:56:11-08:00
New Revision: 92ce943e5f05919acf500df5eccf77777b77c867

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

LOG: Revert "[Attributor][FIX] Try to prevent a potential memory leak"

This reverts commit 2ac37df5d7f385dbf9c9456aae1cc6d0d98587ef.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/IPO/Attributor.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 3b56653985aa5..f7c430065fb4a 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -1519,16 +1519,14 @@ struct Attributor {
     // Use the static create method.
     auto &AA = AAType::createForPosition(IRP, *this);
 
-    // Always register a new attribute to make sure we clean up the allocated
-    // memory properly.
-    registerAA(AA);
-
     // If we are currenty seeding attributes, enforce seeding rules.
     if (Phase == AttributorPhase::SEEDING && !shouldSeedAttribute(AA)) {
       AA.getState().indicatePessimisticFixpoint();
       return AA;
     }
 
+    registerAA(AA);
+
     // For now we ignore naked and optnone functions.
     bool Invalidate =
         Configuration.Allowed && !Configuration.Allowed->count(&AAType::ID);


        


More information about the llvm-commits mailing list