[llvm] 9207a90 - [Attributor] Do not expand dead indirect call sites

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 1 22:16:24 PDT 2023


Author: Johannes Doerfert
Date: 2023-09-01T22:14:38-07:00
New Revision: 9207a90be521421b90216ad1b89863de6e67e590

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

LOG: [Attributor] Do not expand dead indirect call sites

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 dc57c747a23523..26c560cee2173a 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -12292,8 +12292,13 @@ struct AAIndirectCallInfoCallSite : public AAIndirectCallInfo {
     if (!AllCalleesKnown && AssumedCallees.empty())
       return ChangeStatus::UNCHANGED;
 
-    ChangeStatus Changed = ChangeStatus::UNCHANGED;
     CallBase *CB = cast<CallBase>(getCtxI());
+    bool UsedAssumedInformation = false;
+    if (A.isAssumedDead(*CB, this, /*LivenessAA=*/nullptr,
+                        UsedAssumedInformation))
+      return ChangeStatus::UNCHANGED;
+
+    ChangeStatus Changed = ChangeStatus::UNCHANGED;
     Value *FP = CB->getCalledOperand();
     if (FP->getType()->getPointerAddressSpace())
       FP = new AddrSpaceCastInst(FP, PointerType::get(FP->getType(), 0),


        


More information about the llvm-commits mailing list