[llvm-branch-commits] [clang] [llvm] [llvm] Introduce callee_type	metadata (PR #87573)
    Nikita Popov via llvm-branch-commits 
    llvm-branch-commits at lists.llvm.org
       
    Fri Jul 18 12:27:44 PDT 2025
    
    
  
================
@@ -3156,6 +3157,20 @@ static void combineMetadata(Instruction *K, const Instruction *J,
                    MDNode::getMergedCallsiteMetadata(KCallSite, JCallSite));
   }
 
+  // Merge callee_type metadata.
+  if (!AAOnly) {
+    auto *JCalleeType = J->getMetadata(LLVMContext::MD_callee_type);
+    auto *KCalleeType = K->getMetadata(LLVMContext::MD_callee_type);
+    // Drop the callee_type metadata if either of the call instructions do not
+    // have it.
+    if (JCalleeType && KCalleeType) {
+      K->setMetadata(LLVMContext::MD_callee_type,
+                     MDNode::getMergedCalleeTypeMetadata(
+                         K->getContext(), KCalleeType, JCalleeType));
+    } else
+      K->setMetadata(LLVMContext::MD_callee_type, nullptr);
+  }
----------------
nikic wrote:
Can you please move the handling for this into the switch? The separate handling after the switch is only necessary for special cases that don't drop the metadata if one instruction doesn't have it.
https://github.com/llvm/llvm-project/pull/87573
    
    
More information about the llvm-branch-commits
mailing list