LGTM as well, just trying to give some tips on minimizing file check predicates, nothing important:<div><br></div><div><div>--- test/CodeGen/X86/iabs.ll<span class="Apple-tab-span" style="white-space:pre">   </span>(revision 158160)</div>
<div>+++ test/CodeGen/X86/iabs.ll<span class="Apple-tab-span" style="white-space:pre">  </span>(working copy)</div><div>@@ -1,13 +1,18 @@</div><div>-; RUN: llc < %s -march=x86-64 -stats  |& \</div><div>-; RUN:   grep {5 .*Number of machine instrs printed}</div>
<div>+; RUN: llc < %s -march=x86-64 | FileCheck %s</div><div> </div><div> ;; Integer absolute value, should produce something at least as good as:</div><div>-;;       movl %edi, %ecx</div><div>-;;       sarl $31, %ecx</div>
<div>-;;       leal (%rdi,%rcx), %eax</div><div>-;;       xorl %ecx, %eax</div><div>+;;       movl   %edi, %eax</div><div>+;;       negl   %eax</div><div>+;;       cmovll %edi, %eax</div><div> ;;       ret</div><div>+; rdar://10695237</div>
<div> define i32 @test(i32 %a) nounwind {</div><div>+; CHECK: test:</div><div>+; CHECK: mov</div><div>+; CHECK-NEXT: neg</div><div>+; CHECK-NEXT: cmov</div><div>+; CHECK-NEXT: ret</div><div>+; CHECK-NOT: sar</div><div><br>
</div><div>You don't really need the 'sar' -NOT assertion here. Once you hit 'ret', game's over. =] Generally, you'll need -NOT when you don't check everything in-between the start of the interesting pattern ('mov' here), and the end (usually 'ret').</div>
</div>