<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/102142>102142</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[LV] Does the loop fail to vectorize because alias ?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</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/xPMb4YWWc
```
#define TOTAL_ATOMS 98282 // unroll it is const
typedef struct VECTOR {
float x; float y; float z;
} VECTOR;
int foo (int max_omp_threads, int total_atoms, VECTOR * restrict frc, VECTOR ** restrict tmp_frc) {
for (int i = 0; i < total_atoms; i++) {
// #pragma clang loop vectorize(assume_safety)
for (int j = 0; j < max_omp_threads; j++) {
frc[i].x += tmp_frc[j][i].x;
frc[i].y += tmp_frc[j][i].y;
frc[i].z += tmp_frc[j][i].z;
}
}
return 0;
}
```
* I try to add the #pragma clang loop vectorize(assume_safety) for the above kernel loop, and it can vectorize .but when comment it, it failed to vectorize
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVF-P2zYM_zT0C9HAlv8_-CE5L8CAFjdshxZ7CmRZTnSTrUCi00s-_SCdL5d03QE1BIki-eM_0eTOqf0kZQP5BvI24jMdjG1OQz8MUWf6cwNsjSQdQbrGA9HRQboGtgW23Qux2pu-M5pWxu6BbS_Ati9_fOmyv799ExC3EK-hiJf1emVpLwc1SXx6fFp_3q2fHr_8hXXFKob4ahbnyRqtUREqh8JMjhZs2Ol8lL0c0JGdBeHX3x6eHv9EKDevYkTEQRtO-ALp5o0-e_qVvEC6qELZLvB3VtjVRDgYg8AqT478ZWfG444OVvLeAXtAzyZDXO84mTGw3gJha7TSkVWCcLDiXnQnpfG4Cxr1bfiDsW-OFULaYuxj9-TDnUvPBLYJ69bAUkRg6dHy_chRaD7tURtzxJMUZKy6SGAVd24e5c7xQdIZWL3Ab9w_v7t_Du5_LIQX_CyE8PnM8o2CvF29oFdJ22vG-eYZ8vYqvpb_P8jzx8jz_yMvHyMvd0go27fLLbmcVtJsp1CIa-P8vLmXFl_j70j2jGSQ9z3SQeKvv0d4CQ_lnTlJ_EfaSeoA8y3Fp97_IIJP70Zw1c2E3w9yQmHGUfoOotCthANXWvY-oqt61DdpX6c1j2STlIzVeVLUSXRo4qJIuzKTnBd1KbJSJFKm-cDipCuGpBaRaljMsriKiyTNkjRZdVVVlX1WdknRVWXBIYvlyJVeaX0a_WyIlHOzbJKYJRmLNO-kdmHkMDbJ7xikwJifQLbxoE_dvHeQxVo5cu9mSJEOs-rzV8hbbI10oUahmj7Huwyxk4LPTiLXijuEdBvNVjc_TDFFh7lbCTMC23pHy_HpaM2zFARsG8JzwLZL_KeG_RsAAP__yiWJuQ">