[llvm-commits] [llvm] r91378 - in /llvm/trunk: lib/CodeGen/SelectionDAG/DAGCombiner.cpp test/CodeGen/X86/setcc.ll test/CodeGen/X86/zext-shl.ll

Chris Lattner clattner at apple.com
Mon Dec 14 17:47:00 PST 2009


On Dec 14, 2009, at 5:45 PM, Evan Cheng wrote:

>
> On Dec 14, 2009, at 5:00 PM, Chris Lattner wrote:
>
>>
>> On Dec 14, 2009, at 4:41 PM, Evan Cheng wrote:
>>
>>> Author: evancheng
>>> Date: Mon Dec 14 18:41:36 2009
>>> New Revision: 91378
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=91378&view=rev
>>> Log:
>>> Propagate zest through logical shift.
>>
>> Is this really profitable in the general case?  It seems that this  
>> should only be done if at least one of the inputs to the shift will  
>> fold away.  Adding a nice "WouldFoldAZExt" predicate that would  
>> return true for zext/trunc would make sense, no?
>
> Are there cases where (zext (zext)) would not fold into a single zext?

No, I'm worried that you're turning something like:

zext(shr(call, call)) -> shr(zext(call), zext(call))

which introduces two zexts and deletes one.

-Chris



More information about the llvm-commits mailing list