[llvm-commits] [llvm] r130005 - in /llvm/trunk: lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/README.txt test/CodeGen/X86/shrink-compare.ll

Chris Lattner clattner at apple.com
Fri Apr 22 14:23:05 PDT 2011


On Apr 22, 2011, at 11:47 AM, Benjamin Kramer wrote:

> Author: d0k
> Date: Fri Apr 22 13:47:44 2011
> New Revision: 130005
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=130005&view=rev
> Log:
> DAGCombine: fold "(zext x) == C" into "x == (trunc C)" if the trunc is lossless.
> 
> On x86 this allows to fold a load into the cmp, greatly reducing register pressure.
>  movzbl	(%rdi), %eax
>  cmpl	$47, %eax
> ->
>  cmpb	$47, (%rdi)
> 
> This shaves 8k off gcc.o on i386. I'll leave applying the patch in README.txt to Chris :)

This is helping a whole lot on top of the patch I'm cooking (in the README).  Can I entice you to do the ZEXTLOAD case as well?  I'm seeing a lot of:

-        cmpw    $61, (%rdi)

+         movzwl  (%rdi), %eax
+         cmpw    $61, %ax

Which is causing bloat.

-Chris



More information about the llvm-commits mailing list