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

    <tr>
        <th>Summary</th>
        <td>
            [DAG] TargetLowering::expandABD - investigate alternative expansions
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            llvm:SelectionDAG
      </td>
    </tr>

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

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

<pre>
    As mentioned here by @jayfoad https://github.com/llvm/llvm-project/pull/84431#issuecomment-1986043833

> Incidentally Hacker's Delight has a section "Average of Two Integers" which has some neat tricks for implementing these operations without extending to N+1-bit integers.

These include alternative code for targets with poor MIN/MAX/SAT/CMPSEL instructions as well as simpler expansions depending upon the knownbits/numsignbits of the operands.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk0FvozwQhn-NuYwSGZsQcuBAS_m-attqtclhrzaegFtjI9skzb9f4XbV3eNesNCMZ-Z9_YwIQQ8WsSa7O7JrM7HE0fn6x7ejnpzNpFO3ugkwoY3aWVQwokeQNyAFfRW3sxMKxhjnQHhDWEdYN-g4LnLbu4mwzpjL72Mze_eKfSSsmxdjCOuqouA5YVyHsGDvprXJJj9UJS14xTmhLaHN55c_wKPttUIbhTE3-F_0b-gJ2wdo0ehhjDCKAAIC9uukQBhrLujFgODOcLo6eLQRB_SBMAbXUfdjuhHchGBRRIhe928Bzs6DnmaDSbMdII4YENyMXqyVA1x1HN0SAd8jWpVSHLwQdpdvpI6gP_ts_xRwSkW07c2iEISJ6K2I-oLQO4WpaRR-wPhRHmbnPDw_vhDWPTc_CeuOzYmw7v75-_HhCbQN0S_9xzgiwBWNWc-QBveA77OwIUUVzp9DLrOzqxh4s-5qpY6BsM4u0wrA-rf6tIaTUqvCNlM1Vwd-EBnW-T6nlLJqV2RjzfMSVSWUqsqKSYG7syoqStVeSKlKWWW6ZpQVlNNDXhZ7Xmw5FUzmYl_y8iDl7kwKipPQZruSsXV-yBIEdVWU_JAZIdGEhCRjg3MKztqHCCmHMEbYPWEsscWbI5qPJ2-b_9bYrs18nYCTyxBIQY0OMXw1ijqahPuav2vhlGx_clf02g4rxrxJ_qnmroUNaHvBEPUg4t_v9uVxtnhT__MSJDEhrUHJD78CAAD__7gpLjo">