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

    <tr>
        <th>Summary</th>
        <td>
            [AArch64][GlobalISel] Improve divide by constant
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:AArch64,
            llvm:globalisel
      </td>
    </tr>

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

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

<pre>
    SDAG has some improved code generation for expanding sdiv/udiv by a constant, avoiding the need for expensive sdiv/udic operations and scalarization of vector types. We should look into improving the same capability in GISel.

Scalar: https://godbolt.org/z/W817YfWxW
Vector: https://godbolt.org/z/c9ME7Eqc4
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMkk9vnDAQxT_NcBllBQYWOHAg2RDl0FOkrnr0nwHcGJvaBmXz6aslu2rVU08chvd-b8aPh6BHS9RC-QjlKeFrnJxvFd9oHj2RTYRTl_bt1L3gxAMGNxPqefFuI4XSKcKRLHketbM4OI_0sXCrtB0xKL0B61elNxQX5CidDZHbCOwJ-eb0_lecCC2RuovJBr3RX2KJbrkBAnKrMEhuuNefX0w34EYyOo_xslA44JkwTG41Co1z76htdLfEd1zgM6HkCxfa6HhBbfHl9Y3MAdIO0u5t94e8wynGJUDeAeuB9aNTwpl4cH4E1n8C6891Vv0Yzh9nSLvve4j_Ucnm23P1_EsWiWpz1eQNT6jNqpzV9TFvimRqWZFVJElVVXMc8oG4yLiiQZXHlFeF4IluWcqKLGNNlmd1UR0qMTS1UE2mKimarIYipZlrczBmm6_sRIewUptlddqkieGCTNgfnTHB5TtZBXnXdV5OxwIYA_YEjF3FkHejcYIbHchcJ-Up8e118iDWMUCRGh1i-AOKOpq9T3e38gTl48vucb0ylCd8_WoQKr1pRdd23LuRrN60_1xQx2kVB-lmYP0e6evzsHj3k2QE1u_LBWD9bb-tZb8DAAD__7_n8Qo">