<div dir="ltr"><div><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif">Hello all,</p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif">I am looking at the assembly code of a loop body which is created by applying O3 optimization. Here it is: <br>
<br>.LBB4_19:                               @ %for.body.91 <br>                                        @ =>This Inner Loop Header: Depth=1 <br>        ldr r0, [r5] <br>        mov r1, r8 <br>        add r0, r0, r7 <br>        vldr s0, [r0] <br>        mov r0, r6 <br>        vcvt.f64.f32 d0, s0 <br>        vmov r2, r3, d0 <br>        bl fprintf <br>        cmp r0, #0 <br>        blt .LBB4_25 <br>@ BB#20:                                @ %for.cond.89 <br>                                        @   in Loop: Header=BB4_19 Depth=1 <br>        ldr r0, .LCPI4_2 <br>        add r4, r4, #1 <br>        add r7, r7, #4 <br>        ldr r0, [r0] <br>        cmp r4, r0 <br>        blt .LBB4_19 <br>
<br>There are no other basic blocks in the loop.  I am wondering why the first load instruction (ldr r0, [r5]) is repeatedly executed in the loop while the load address (r5) is never changed in the loop body. Shouldn't this instruction be moved out of the loop as a result of -licm flag? I mean this load could have been executed only once outside of the loop and the result could have been saved in the register and used in the loop. I'd greatly appreciate if anyone can tell me why this is not the case. <br>
<br>Thank you in advance, <br>Fami </p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:Calibri,sans-serif"> </p></div></div>