[llvm] 6158f4a - [Attributor][NFCI] No repeated manifest of AAValueSimplifyReturned (CGSCC)

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 6 18:00:37 PST 2022


Author: Johannes Doerfert
Date: 2022-03-06T19:59:23-06:00
New Revision: 6158f4a466d9293bc96d29e451d4552d70d21560

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

LOG: [Attributor][NFCI] No repeated manifest of AAValueSimplifyReturned (CGSCC)

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index bf97e33feb89d..0a8d3383ee9e3 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -5548,6 +5548,11 @@ struct AAValueSimplifyReturned : AAValueSimplifyImpl {
 
   ChangeStatus manifest(Attributor &A) override {
     ChangeStatus Changed = ChangeStatus::UNCHANGED;
+    if (!A.isRunOn(*getAnchorScope()))
+      return Changed;
+
+    assert(!hasCallBaseContext() && "Should never manifest a simplified "
+                                    "function return with call base context!");
 
     if (auto *NewV = getReplacementValue(A)) {
       auto PredForReturned =


        


More information about the llvm-commits mailing list