[llvm] c3f3068 - [Attributor][NFCI] Add a shortcut for constants

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 10:27:38 PDT 2023


Author: Johannes Doerfert
Date: 2023-07-19T10:27:01-07:00
New Revision: c3f30687b583fd4381065d8750287e3176ac75b5

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

LOG: [Attributor][NFCI] Add a shortcut for constants

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 0bfcb8ce8bc534..3a9a89d613553a 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -10420,6 +10420,11 @@ struct AACallEdgesCallSite : public AACallEdgesImpl {
     SmallVector<AA::ValueAndContext> Values;
     // Process any value that we might call.
     auto ProcessCalledOperand = [&](Value *V, Instruction *CtxI) {
+      if (isa<Constant>(V)) {
+        VisitValue(*V, CtxI);
+        return;
+      }
+
       bool UsedAssumedInformation = false;
       Values.clear();
       if (!A.getAssumedSimplifiedValues(IRPosition::value(*V), *this, Values,


        


More information about the llvm-commits mailing list