<div dir="ltr">On Fri, Nov 20, 2015 at 5:06 PM, James Molloy <<a href="mailto:james@jamesmolloy.co.uk">james@jamesmolloy.co.uk</a>> wrote:<br>><br>> Hi,<br>><br>> We'd need to look precisely at what's causing the code size bloat. The midend commit pointed out by Steve shouldn't cause bloat in and of itself - it should reduce code size. It removes a load of stores and branches.<br>><br>> I know a backend change I made to ARM isn't behaving as well as it could, and I have patches to fix that. Speculatively reverting midend patches isn't the best way to approach this, in my opinion! :)<br>><br><div class="gmail_default" style="font-family:'courier new',monospace"><br></div><div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​​</div>For i586, the effect of r252152 seems to cause cmoves instead of branches.<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​  Code size increase is +35% for i586.  </div>Unfortunately the object files are wildly different in a way that does not seem to occur in other workloads.  I tried to clip a concise before and after case.<br><br><font face="monospace, monospace">Before<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​:</div></font><div><font face="monospace, monospace"><div class="gmail_default" style="font-family:'courier new',monospace;display:inline">As a reference point, I found OR $0x408 and OR​ $0x810 in close proximity.</div><br><br> 278: 81 ca 10 08 00 00     or     $0x810,%edx<br> 27e: 89 10                 mov    %edx,(%eax)<br> 280: f6 c1 40<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​          ​</div>    test   $0x40,%cl<br> 283: 74 08                 je     28d <t_run_test+0x28d><br> 285: 81 ca 08 04 00 00     or     $0x408,%edx<br> 28b: 89 10                 mov    %edx,(%eax)<br> 28d: 84 c9                 test   %cl,%cl<br> 28f: 0f 89 34 01 00 00     jns    3c9 <t_run_test+0x3c9><br><br><br>After<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​ r252152:​</div><br>Note that the OR $0x408 and OR $0x810 come <div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​now ​</div>in reverse order.<br><br><br>35d: 81 c9 08 04 00 00     or     $0x408,%ecx<br>363: 89 4c 24 28           mov    %ecx,0x28(%esp)<br>367: 89 df                 mov    %ebx,%edi<br>369: 83 e7 10<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​        ​</div>      and    $0x10,%edi<br>36c: 89 7c 24 20           mov    %edi,0x20(%esp)<br>370: 0f 45 d1<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​           ​</div>   cmovne %ecx,%edx<br>373: 89 d7                 mov    %edx,%edi<br>375: 81 cf 10 08 00 00     or     $0x810,%edi<br>37b: 89 7c 24 14           mov    %edi,0x14(%esp)<br>37f: 89 d9                 mov    %ebx,%ecx<br>381: 83 e1 20<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​       ​</div>       and    $0x20,%ecx<br>384: 89 4c 24 1c           mov    %ecx,0x1c(%esp)<br>388: 0f 45 d7<div class="gmail_default" style="font-family:'courier new',monospace;display:inline">​        ​</div>      cmovne %edi,%edx<br>38b: 89 d7                 mov    %edx,%edi</font><br> </div><div><br></div><div><div class="gmail_default" style="font-family:'courier new',monospace">HTH,</div><div class="gmail_default" style="font-family:'courier new',monospace">-steve​</div><br></div></div>