[llvm-branch-commits] [llvm] [Metadata] Preserve MD_prof when merging instructions when one is missing. (PR #132433)

Teresa Johnson via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Mar 21 11:44:00 PDT 2025


================
@@ -3436,6 +3433,16 @@ static void combineMetadata(Instruction *K, const Instruction *J,
     K->setMetadata(LLVMContext::MD_callsite,
                    MDNode::getMergedCallsiteMetadata(KCallSite, JCallSite));
   }
+
+  // Merge prof metadata.
+  // Handle separately to support cases where only one instruction has the
+  // metadata.
+  auto JProf = J->getMetadata(LLVMContext::MD_prof);
+  auto KProf = K->getMetadata(LLVMContext::MD_prof);
+  if (!AAOnly && (JProf || KProf)) {
----------------
teresajohnson wrote:

The old handling was guarded on DoesKMove - what is the implication of removing that?

https://github.com/llvm/llvm-project/pull/132433


More information about the llvm-branch-commits mailing list