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

    <tr>
        <th>Summary</th>
        <td>
            Issue with running loop-flatten pass
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          cxjiang-bk
      </td>
    </tr>
</table>

<pre>
    Hi there! I have trouble running the loop-flatten pass. I tried to run that pass using `opt -passes="loop-flatten ./<InputFile> -S -o ./<OutputFile>"` and my c++ test file is 
`int array[1024];

int foo() { 
    int b = 0;
    for(int i = 0; i<1024; i++){
        for(int j = 0; j<1024; j++){
            b += array[i+j];
        }
    }
    return b; 
}` 
I compiled it using clang and the command is `clang -O1 -S -emit-llvm -Xclang -disable-O0-optnone -fno-discard-value-names ./input.c -o ./input.ll`. But after I check the output file, it seems that it didn't do the flatten job. Is there anything wrong with my invoke method? Or am I missing some prerequisite passes? Thanks!
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VE-TuzYM_TTiooExdgLLgcMvSzPNaQ_toVcDSnDW2NQWu91v3zFJ9s90ysHYenqyLD1bx2gujqiF_QH2XaZXnnxoh3-uRrtL3r9mvR8_2t8N8kSBQJZ4wkm_EXLwa28Jw-qccZeEo_V-yc9WM5PDRcdY4Ak5GBqRffJEnjRvCK4xsaASfmHMk4kiqA6k_BGlAHkE9Xxyy8pHYwnUb5j_gbl_IC8rf0EgJVQCtRtx_sAB5AHkAZki49lYQhMRRAfiF1TCOEYdgv6A_aEUcgf7DtThDm9j8jh7D_IJZINQH-5kRMSE9QiqQ_HJSvazDyCfEmo-UTSgnrcttvmWFMgG6m-8n9zrF_f6jXv9f276ekyg6j6Plfa6fj_XwxPq7svwYxGI1-CwT9vda1F3qaa3xQkHPy_G0oiG7z0crHaXreZJA4Of5zRPpa7EDctfyq1pNBvOrX2bMf_rjowm6t5S_iJyv7DzjjA_O5_sgw5j_qbtSrnTM8Wt4yYJoRgeArgtrYVKFHhYGfWZKeAJh4mG1y0hvwlk6z_I55R2JJrjTYqGcTSjA1kzjn7zfyjv6vsCT_EmfNTug6d02vfg02h4ShIz7s2_Es7Ekx9BHfEloJ7xhLOJW3GinwmXQIH-Xk00TPiQ-hH_nLR7jSDLbGzV2KhGZ9SWtShrVVWVyKZ2fJJUUrVrGimHSu3O_ThIvdd9OehzL3RmWimkKqXYC6HqnSiemqaqGyGqstTDrqphJ2jWxhap7IUPl8zEuFJb71SjMqt7snG7_FI6escNTLdo32WhTZy8Xy8RdsKayPErChu21J6S-60Yj3fgP29AtgbbTsxLBPUr3Vl5vBie1r4Y_AzymELef_kS_JUGTo1NkSPI45bovwEAAP__Gfppzw">