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

    <tr>
        <th>Summary</th>
        <td>
            [LoopInterchange] transform when the tripcount of outloop is small const value
        </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/jnbq9oY5a
```
void check_orig (int a[6][100])
{
 for (int k = 0; k < 3; k ++)
  for (int j = 0; j < 2; j ++)
    for (int i = 0; i < 100; i += 4)
    {
      a[k*j][i * 4] = 1;
    }
}  
```

* when the LoopInterchange is done, the inner loop will unroll so the the nested loop will turn into a single level loop, then it will benifit to the branch prediction and will reduce the instruction flush.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsk9GOqzgMhp_G3FhThQQYuOCiTFVppX2BvVqFxEA6adJNQkd7nv6IlFFnRgcFcGR_1u84ljGa2RH1UA9Qnwq5psWH_j7paSpGr__vgR8xUUwgjrikdIsgjsDPwM-zUofZ69HbdPBhBn7-Bfx8ceN_nf-nlsBOwI7QsH3l7d0bjWoh9f6vD2ZG4K1xCSXUQwP1CeqhZGwzeLfzr8PDwMmHz_B3BHFCBmLI5huK3eRDXjuLX5nLk7lkhu_mT-YbZZ6UydQm77Hhw-aqvpFPtfnZynoHfrw8StugI1ZQn3LWEsTwFT19VnxC_OPh7V9-xI-FHKaF8G_vb3-5REEt0s2EJqL2joC_ZbdxjgJa72_4YazF1QVvLUafvdvrKCbSX0LSGhwalzxKjMbNltDSnWwO2fM6NOkRPZIzk0mYHhnHIJ1a8BZIG5WMdyidfkQG0quiXVVMYX34J7vG5VDoXuhOdLKgvmw6UXWsbpti6buWlU3LVKenulIlF53ohB5rqWXTEVWF6TnjgrWiLCsmWHUQYyOJ87btXoVseQkVo6s09mDt_brd08LEuFLf1GVVFlaOZGO-_Zw7-sDsBM63YQj9xryM6xyhYtbEFJ9Zkkk2j82PFmzdTUG6OPlwfTYqBXNTfnUJ_YR-TfnATcR4ldai8i4mvEu7UrEG2_8YNJOWdTwofwV-3gTsv5db8BdSCfg5y47Az7ms3wEAAP__aHgjeQ">