<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58187>58187</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Add optimization remarks for likelihood attribute disagreements
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            c++20,
            PGO,
            llvm:optimizations,
            clang:diagnostics
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          AaronBallman
      </td>
    </tr>
</table>

<pre>
    C++20 added the `[[likely]]` and `[[unlikely]]` attributes as optimization hints. Some users expect these hints to be an escape hatch that instructs the optimizer to ignore what it thinks it knows about a particular branch probability. Other users expect these hints to be ignored when the optimizer has more information about the probability of taking a branch (such as through PGO).

It would be nice to have optimization remarks issued for any situation where the optimizer elects to ignore an explicitly-annotated branch so that users have some way to know if their expectations are being met or not.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFU9tunDAQ_Rp4sYLAwMI-8LBJ1KpPqdQvGPAA7hob-ZLN9us7hk2TNJUqjcBmhjlnzrF7I67dQ8LvKXjOQAgUzM_IkkOe1PcUSp5RXZP6McaBSrR4Swb9Ke29lX3w6Bg4ZlYvF_kLvDSazVJ7l7EfZkEWHFrH8GXFwUc8h3uaecN6JBCGboCVvoIfZqoAz6R23oYhFhHBW2u08Rc5aWORXbay2FDqs4urszYXYtKb4BmwFayXQ1BgWW9BU-PVmh56qaS_ZuyJ-tr_UduhBGGh_ovITBMvkYfUo7HLPvWOHQvfYTEzMg9nqSdidaOS8NYFekOcz5owzez716eEH7Mkf0zy0_785tnFBCUiFS0HjKxmeMaPUltcwEYFnAvEldiQpFfmpA97AbEnnh_po8JhH_MmZ3ThZVVykF5d70Br48FTuxthZ3ZfdsE2Ei56e4FrbBKlZ3KMINLe9NzAyQ9q3mOcfkHPiBx1zlLsisOhzuumbctUdKU4lkdIPYFjdxLi3xPG0bYzKGdjxNvxY0I6mCziguRdGqzqZu9Xl5SnhH-hmKSfQ58NZqGNUs-vrzuy6SdRpe2mnqNF3RZtk85d2eRjDSVvRzEWZVEPx5E3omnaHksh6jxV0KNyXbwcnA-v14rWCX8gg_lm6OtmAy1P78dyb9lBgZ4oLSSQG47O7ZasH1PZ8ZzzIs8PBc-rqsya46GqMC-qY4VNVVdJlZM6UmURITN2Sm23jdaHyVFSSUcX8U8SnCPDETfa1B-Cn43tTmCNvgelFtDpJkW36fAba8Bvmg">