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

    <tr>
        <th>Summary</th>
        <td>
            AArch64: sdot/udot not generated with variable or high trip counts
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    The following test is not generating sdot/udot (depending on types) when the tripcount is variable, or if the loop is not unwound (the cutoff is at 60 trips, though may differ per target).

```
#include <stdint.h>
int32_t f(int8_t * restrict x, int8_t * restrict y, int n)
{
  int32_t r = 0;
  for (int j = 0; j < n; ++j) {
      r += x[j] * y[j];
  }
  return r;
}
```
clang (does not generate sdot): https://godbolt.org/z/KznKr1Kh8

gcc (generates sdot): https://godbolt.org/z/h1xqM1xMc

If you replace 'n' with some value < 60, you will see the instructions. Same problem with unsigned. This appears to be a problem with neoverse-n1, neoverse-v1 and neoverse-v2
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2P4ygQ_TX4UurIxokdH3xIOhtp1ZrTzn2EoWxoEfBCkXTm169wPjYz2stGkV3lB-9BfYkYzeQQe7bZs82hEIm0D32I0hOdhLN4LQavrv13jTB6a_3FuAkII4GJ4DzBhA6DoPw5Kk-MH5PyBIxvFc7oVAa8A7rOGBnv4KLRAWkECmaWPrmF6SyCEYNFxt_BBzDjssR6Pz90krv45FQmzpBM5Mcxg4KgKRe2mHeT9mnScBJXUGYcMcCMAUiECYnxbsXKAyt392dT3v83l9fGSZsUAqvfIynjaKVZ_ccNNo5q_oNgZHxrHG1_5FvuIGCkYCTBV5b_L-B6B8Ax3t2l2v3NAHjQBmD1AUpWP5HRB7hpwecTXMx3cNlkfM_4_jOH9YUw_8KC1Qf4Ypv9J9sclhNd786LBmsPDzMgpeAgPNEn9lucpBVuWjLs8ZciwHsJdKzegSaaI6t3jB8ZP05eDd7SyoeJ8eNPxo8fP91HqD709jUjk5SZ-MEX_w-hrr7-_lZ9fZOvhH-OcPUJAs5WSATGW8d4CxdDGqI_IZyFTUu-oSlznvLqi7EWIuJShMZFCkmS8S6u4C9xQpiDHyyebizJLT2kVvBd53KcZxQhAnkYEMSvax36M4aIb67KWk_3XIFw6sXnhepr1dWdKLCv2rJtm3WzqQrdD7zbbodGlKrBrqmrlpeyFfVGta1aK14WpuclX5e84lVXrqtqVQ8CpeSlEnUzVvWWrUs8CWNX1p5POX6FiTFhv602VVNYMaCNy0Dg3OEFFpBxnudD6POetyFNka1LayLFf1nIkMV-twtSN-ucsNd58Fol6haMR8_nhtdm0ksPwzISYpGC7X9LuCGdhpX0J8aPWfT-epuD_0SZlZajRsaPy1X-CQAA___Hs4LD">