[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 21:45:35 PST 2009


On Dec 14, 2009, at 5:49 PM, Evan Cheng wrote:
>>>> 
>>>> 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.
> 
> No. The transformation only happens when one of the shift's operand is a zext.

Oh ok!

-Chris



More information about the llvm-commits mailing list