<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dear LLVM developers,</div><div><br></div><div>Recently I want to try the pass '-loop-unroll-and-jam' to observe how the IR is transformed, but I don't see the IR changed after doing the following steps.</div><div><br></div><div>Here are the details for preparing my experiment and I have tried the LLVM 6, 7 and 8:<br><br></div><div>1) Simple 2D array source code (loop.c) is given</div><div><br></div><div>```<br></div><div style="margin-left:40px">#define M 32768</div><div style="margin-left:40px">#define N 32768</div><div style="margin-left:40px"><br></div><div style="margin-left:40px">double a[M][N], b[M][N], c[M][N];<br></div><div style="margin-left:40px"><br></div><div style="margin-left:40px">int main() {</div><div style="margin-left:40px">    for (int i = 0; i < M; i++) {</div><div style="margin-left:40px">        for (int j = 0; j < N; j++) {</div><div style="margin-left:40px">            c[i][j] = a[i][j] + b[i][j];</div><div style="margin-left:40px">        }</div><div style="margin-left:40px">    }</div><div style="margin-left:40px">    return 0;<br></div><div style="margin-left:40px">}</div><div>```<br><br></div><div>2) Create an LLVM IR file</div><div>./bin/clang -O1 loop.c -emit-llvm -S -o loop.ll</div><div><br></div><div>3) Run the 'unroll-and-jam' pass</div><div>./bin/opt -loop-unroll-and-jam loop.ll -S -o loop-unrolljam.ll<br></div><div><br></div><div>I added the option '--debug-pass=Structure' to the opt, and I can see the 'Unroll and Jam loops' indeed executed by the Loop Pass Manager.</div><div>```<br></div><div><div style="margin-left:40px">   ModulePass Manager<br>       FunctionPass Manager<br>        Dominator Tree Construction<br>        Basic Alias Analysis (stateless AA impl)<br>        Function Alias Analysis Results<br>        Natural Loop Information<br>        Scalar Evolution Analysis<br>        Dependence Analysis<br>        Canonicalize natural loops<br>        LCSSA Verifier<br>        Loop-Closed SSA Form Pass<br>        Loop Pass Manager<br>          Unroll and Jam loops<br>        Module Verifier<br>       Print Module IR<br></div>```</div><div><br></div><div>I also tried to add the option '-debug' to the opt to see if there is the debug information printed by LoopUnrollAndJam, but nothing.<br></div><div><br></div><div>Thank you very much.<br></div><div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span><span style="font-family:pmingliu,serif">Zhen Wei (魏禛)</span><br><span style="font-family:pmingliu,serif">Master Student</span><br><span style="color:rgb(0,0,0);font-family:pmingliu,serif">Department of Computer Science & Information  Engineering</span><br><span style="color:rgb(0,0,0);font-family:pmingliu,serif">National Taiwan University</span><br><span style="font-family:pmingliu,serif">Email:  <a href="mailto:zhenwei.tw@gmail.com" target="_blank">zhenwei.tw@gmail.com</a></span><span style="font-family:pmingliu,serif"></span></span></div></div></div></div></div></div></div></div></div></div></div></div>