[Attributor][NFCI] Add a shortcut for constants
authorJohannes Doerfert <johannes@jdoerfert.de>
Wed, 19 Jul 2023 17:13:03 +0000 (10:13 -0700)
committerJohannes Doerfert <johannes@jdoerfert.de>
Wed, 19 Jul 2023 17:27:01 +0000 (10:27 -0700)
llvm/lib/Transforms/IPO/AttributorAttributes.cpp

index 0bfcb8c..3a9a89d 100644 (file)
@@ -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,