<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/137614>137614</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AArch64][SVE] can fold whilele comparison with MAX to ptrue
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
Here is the test case from gcc testsuite(gcc.target/aarch64/sve/acle/general/whilele_12.c).
https://godbolt.org/z/o65qTs1T6
```c
#include <arm_sve.h>
#include <limits.h>
svbool_t
f1 (volatile int32_t *ptr)
{
return svwhilele_b8_s32 (*ptr, INT32_MAX);
}
svbool_t
f2 (volatile uint32_t *ptr)
{
return svwhilele_b16_u32 (*ptr, UINT32_MAX);
}
svbool_t
f3 (volatile int64_t *ptr)
{
return svwhilele_b32_s64 (*ptr, INT64_MAX);
}
svbool_t
f4 (volatile uint64_t *ptr)
{
return svwhilele_b64_u64 (*ptr, UINT64_MAX);
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUk81u2zoQhZ9mtCEiUEOKlhdayHGEexfppkmRnUDRY4stLbokZaN9-kJO0qJ2f1JAADGaOfp0iDk6RrsbiWooV1CuMz2lwYf6040OwZ9i1vvNl_o_CsRsZGkgligmZnQktg1-z3bGnF_FySYCrHbG5EmHHSXAVutgBiUB23ikuTZuPnY0UtAOsD0N1pGjrsDcAC5z4M2Q0iGCaADbedRveu9S7sMOsP0K2HpVfn6IxYMC3oDiz4-ZCxR2NG7aEANxq8O-i0fKBxB3V01n9zbF7z3exGPvvesS8GZbMMDq6J1O1hGzYxLYJQbYHFIAXM6CxQp4wwKlKYwsHl9d9FUXBc7y1-lb9v-7B4HdffM0S8XqrF5fQ_En6PQH6i-wheqmS-7jG8Hi0q2Sb-YK7KKSV36V_DtWXvn9B66S3XTJffwt-HVHsk0tNkux1BnVxUKWlVioqsqGuixUhaLfbIu-WBiOhdKSzILrLZVLUiqzNXIsucSq4KWUVd4rNMvtskLdl1uue5Cc9tq63Lnjft7VzMY4UV2IhSpk5nRPLp4ThjjSiZ27gDgHLtSz6KafdhEkdzam-OMzySZ3jmbTPCepXEO5ev_hDso1M3pkW-827OVimPH7gw42-pGdbBrYffPEkmeHFCbKpuDqi2zZNEx9bvwesJ2RL8fNIfiPZOYAn380ArYvTo41fgsAAP__8etFlw">