[llvm-commits] [llvm] r68576 - in /llvm/trunk: include/llvm/Target/ lib/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/X86/ test/CodeGen/X86/

Dan Gohman gohman at apple.com
Wed Apr 8 09:22:38 PDT 2009


On Apr 7, 2009, at 11:50 PM, sanjiv gupta wrote:

> On Wed, 2009-04-08 at 00:15 +0000, Dan Gohman wrote:
>
>> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=68576&r1=68575&r2=68576&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Tue Apr   
>> 7 19:15:30 2009
>> @@ -777,6 +777,48 @@
>>   return false;
>> }
>>
>> +/// ShrinkDemandedOp - Convert x+y to (VT)((SmallVT)x+(SmallVT)y)  
>> if the
>> +/// casts are free.  This uses isZExtFree and ZERO_EXTEND for the  
>> widening
>> +/// cast, but it could be generalized for targets with other types  
>> of
>> +/// implicit widening casts.
>> +bool
>> +TargetLowering::TargetLoweringOpt::ShrinkDemandedOp(SDValue Op,
>> +                                                    unsigned  
>> BitWidth,
>> +                                                    const APInt  
>> &Demanded,
>> +                                                    DebugLoc dl) {
>> +  assert(Op.getNumOperands() == 2 &&
>> +         "ShrinkDemandedOp only supports binary operators!");
>
>> +  assert(Op.getNode()->getNumValues() == 1 &&
>> +         "ShrinkDemandedOp only supports nodes with one result!");
>> +
> This assert breaks via visitADD, when the ADD operation also  
> produces a
> carry, so Op.getNode()->getNumValues() is 2 there.

ADD always has one result. ADDC and UADDO are used to represent an add
with a carry result.

Dan




More information about the llvm-commits mailing list