================
@@ -6008,6 +6009,15 @@ static bool combineInstructionsOverFunction(
     if (!MadeChangeInThisIteration)
       break;
 
+    // Issue #147390: InstCombine emits `select` as rewrites of instructions
+    // without metadata. It may be possible to synthesize some more meaningful
+    // profiles in some cases (based on operands or based on the pattern)
+    if (auto EC = F.getEntryCount(); EC.has_value() && EC->getCount() > 0)
+      for (auto &BB : F)
+        for (auto &I : BB)
+          if (isa<SelectInst>(I) && !I.getMetadata(LLVMContext::MD_prof))
----------------
mtrofin wrote:

Nitpicking: the profcheck verifier doesn't run after every pass, i.e. it 
doesn't affect compile time. It runs around every .ll test (on the profcheck 
bot). Meaning, it's possible selects would arrive here without `!prof` _if_ 
they get inserted in a pass with that behavior left untested.

https://github.com/llvm/llvm-project/pull/157599
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to