[llvm] [profcheck] Annotate `select` instructions (PR #152171)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 5 09:37:51 PDT 2025


================
@@ -26,6 +26,12 @@ using namespace llvm;
 static cl::opt<int64_t>
     DefaultFunctionEntryCount("profcheck-default-function-entry-count",
                               cl::init(1000));
+static cl::opt<bool> AnnotateSelect("profcheck-annotate-select",
+                                    cl::init(true));
+static cl::opt<uint32_t> SelectTrueWeight("profcheck-select-true-weight",
----------------
mtrofin wrote:

```
%x = select i1 %a, i32 1, i32 3
%c = icmp lt i32 %x, 2
br %c .... !prof !10
```
here, there's a relation between `!10` and the weights we should insert for the select. Right now I'm not convinced we need to add complexity in the injector for such cases.

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


More information about the llvm-commits mailing list