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

Benjamin Kramer benny.kra at googlemail.com
Sat Apr 23 11:34:26 PDT 2011


On 22.04.2011, at 23:23, Chris Lattner wrote:

> 
> 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.

The patch should handle ZEXTLOAD just fine, so there must be something else going on here. I don't see
this pattern in a build of gcc (I don't have access to 256.gcc) with your patch applied though. Maybe %eax
has more than one use?





More information about the llvm-commits mailing list