<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63616>63616</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[sve] clang failed to tail folding optimization compare to gcc
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vfdff
</td>
</tr>
</table>
<pre>
* test: https://gcc.godbolt.org/z/4Ks98cP1W
```
real_t s311(struct args_t * func_args)
{
real_t sum = (real_t)0.;
for (int i = 0; i < LEN_1D; i++) {
sum += a[i];
}
return sum;
}
```
* gcc: use whilelo to fold the tail loop
* clang: normal branch for the kernel loop body .LBB0_1
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcUsGOnDoQ_Jrm0lpktxcWDhyGx-OSVZRbjiNjDDgxeGSbjbJfH5mZzewEWeCGKqq7XDIEM29aN1C0UHSZ3OPifPM2jdOUDW783QCdMOoQQZxwifESQJyAeqB-Viqf3Tg4G3PnZ6D-Hah__hLqSn3j34F1wE5Qsts6Sq-lPUcMgnOgKkS_q4jSz-EcMSlN-6bOqQaqbz94aa8bRMQP-r4iiA6BqusboJrlID4hJ-fTZ7NFNAeWgWiP7X_4-v_XM--OGqg9Vo0POuk6RKhNXAlFa6DoHhTgpbt1-Km9uPstMf8i76hHI253OuGsVPJ2Dxp_LcZq6zA6nJwdMS4aozQWrXOXO0NZuc2Jszm_SouDl5tajpET46f2m75yMB0h5q9ty848Gxsx1qKWmW54WVWcl5yJbGmoUJIGpsVQDMQmxUs1UTWwqZKMvVQyMw0xEqwUjNWsIpHrsh5YoScq2FhwKeCZ6VUam1v7tqYwZCaEXTelKHmZWTloGz4i5psEehr2OcAzsybEcKdFE-0RxvCmoeiuo-IkjdVjsuVwI3ljthndJZrVvMto3IbKrRfpdQLNSmW7t80_cTVx2YdcuRWoT4K3x9PFux9aRaD-aDoA9UfffwIAAP__zETpAw">