<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Quentin<div class=""><br class=""></div><div class="">Please review this patch to more aggressively reduce the size of thumb2 functions when methods have -Oz on them.  This is similar to the work you did in r170462, hence asking you to be the reviewer for this one.</div><div class=""><br class=""></div><div class="">The issue I found is that the PostRA scheduler can schedule a mov instruction between a cmp and ‘it’ block, e.g.,</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">       </span>cmp<span class="Apple-tab-span" style="white-space:pre"> </span>r0, #0                  @ encoding: [0x00,0x28]</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">  </span>mov.w<span class="Apple-tab-span" style="white-space:pre">       </span>r3, #0                  @ encoding: [0x4f,0xf0,0x00,0x03]</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>it<span class="Apple-tab-span" style="white-space:pre">  </span>eq                      @ encoding: [0x08,0xbf]</div></div><div class=""><br class=""></div><div class="">This results in the mov instruction here being a 4-byte encoding whereas it could be a 2-byte encoding if CPSR wasn’t live.</div><div class=""><br class=""></div><div class="">This patch schedules another pass of Thumb2SizeReduction before the PostRA scheduler.  This pass is only for functions with minsize set on them.  It results in the mov being converted to Thumb2 before the PostRA scheduler and so the code now becomes</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">   </span>movs<span class="Apple-tab-span" style="white-space:pre">        </span>r3, #0                  @ encoding: [0x00,0x23]</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">  </span>cmp<span class="Apple-tab-span" style="white-space:pre"> </span>r0, #0                  @ encoding: [0x00,0x28]</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span class="Apple-tab-span" style="white-space:pre">  </span>it<span class="Apple-tab-span" style="white-space:pre">  </span>eq                      @ encoding: [0x08,0xbf]</div></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">Thanks,</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">Pete</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""></div></body></html>