<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJylVEuP2yAQ_jX4MtqI4Fd98CHZaG_tuT2tsBnHWNhEgPP69R2T3U121UqVijDM65sX4MaqS_1iHUhwuJ-NdCCediCdkxc4M_EMoUcw1h6gsfOkQHuQxls4oruA1-PBIAQLozyADp4kV1xQkkxbI6c9-KCNgVZOTJQBlL0501NA1_ZkgGAPQY_6KoO204rxHeObrfQkn6AP4eBZumHihebeqsaasLJuT9yVvuKaYT_IX8US80SRS4rlEWPWtus8Btoo2oTuPXDrcPGecQ4nHXpgBZdKwZkvPm4r6UgKKNueqkL3ltWnteBv88aKVGGnJ4Tvm58_YM35ozGeyckEnbEyUFfz7WLE8t0DlW4fATfLUQanz69-Hl9ba-Zxeh3lYB0T345WKyYqYOUbDGjcQGQNLN0B_3AZdXTEhKO2g_5QR_I5Zhw5JrZxVnfcF-xwxw6fsMNfsMuIGZGOkEvtw61w_Vj1YuYwzNQksr43o9x96Xai6lRVaSUTOYfeuvrYqa5LZmfqL3eFjnZuVq0diTHm-L49HZwdsA3Eau9n9ETkaZaWSV-vSyzSskEu8nJdda2SouJNWzayFVUq8sTIBo2vKXsmxIQniC6IplqS_89A14ILwdei5EW-TqtV13UZ79aZUgWKPCtYxnGU2qwWP8szSFwdXTbz3pPSaB_8XSm91_sJMSZMGQYdTGQeXh_JYWf_7XHGm_CHH0US66hjEb8BurlLfA>53437</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[interchange] Don't do loop interchange optimization for a regular 2-D array
</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>
For a regular 2-D array x, the loop bound is also very simple to map its size, and clang still can't do loop interchange optimization.
Base on https://godbolt.org/z/6z4ehjaY6, we'll see the offset of inner loop increase 400 with `add x0, x0, 400` each iter.
```
#define MAXN 100
extern float x[MAXN][MAXN];
float matrix_sum_column_major(void) {
float sum = 0;
for (int i = 0; i < MAXN; i++)
for (int j = 0; j < MAXN; j++)
sum += x[j][i];
return sum;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNU0tv2zAM_jXyhWigyK_64EPSoLftvJ0K2aJjGbIVSHJev36U0zZpsQEzZIkU-X18mG6sutSv1oEEh_vZSAfiaQfSOXmBMxMvEHoEY-0BGjtPCrQHabyFI7oLeD0eDEKwMMoD6ODp5ooRJcm1NXLagw_aGGjlxEQZQNkbmZ4CurYnBwR7CHrUVxm0nVaM7xjfbKWn-wn6EA6epRsmXmntrWqsCSvr9qRd6S2uGfaD_F3EmCeKXFIsj7hkbbvOY6CDok3oPgK3DiN7xjmcdOiBFVwqBWceOW472egWULY9VYXuPasve8Hf100VqcJOTwg_Nr9-wprzR2c8E8kEnbEyUFfzbXRi-e5BSrePgJvnKIPT5zc_j2-tNfM4vY1ysI6J56PViokKWPkOA3puIPIGlu6Af1IuNvrEhKO2g_40L-LLkvGiMbFdVnXHfcMOd-zwBTv8AxufJSOyETLWPtwK149VRzeHYaYmkfe9GeXuW7cTVaeqSiuZBB0M1pHoPkpECTv7f5O2lPWXqU9mZ-pvc0djMjer1o6kGHP8OJ4Ozg7YBlK19zN6EvI0S8ukr6tUVKrJK1w3z8ibrOBKyqzrZJaXlWjTxMgGjY8FMCEmPMFCQTIVkehacCH4WpS8yNdpteq6LuPdOlOqQJFnBcs4jlKbVcwj_hCJq5eUmnnvyWi0D_5ulN7r_YRLvyK_nENvXX3sVNclS-B6SfwPGV42Pw">