[llvm] [PGO][ICP] Prevent indirect call promotion to functions with incompatible target features (PR #192142)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 12:11:39 PDT 2026


================
@@ -695,6 +701,30 @@ bool IndirectCallPromoter::tryToPromoteWithFuncCmp(
 
   for (const auto &C : Candidates) {
     uint64_t FuncCount = C.Count;
+
+    // Check target feature compatibility before promotion.
+    auto CalleeFeatures =
----------------
teresajohnson wrote:

This should just be put into isLegalToPromote. Then you don't need to duplicate it into the SampleProfileLoader, and it will also work for other places that do such promotion (e.g. the MemProf context disambiguation).

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


More information about the llvm-commits mailing list