[llvm-commits] [llvm] r150356 - in /llvm/trunk: lib/Target/X86/X86ISelDAGToDAG.cpp test/CodeGen/X86/dec-eflags-lower.ll

Peter Cooper peter_cooper at apple.com
Mon Feb 13 09:54:15 PST 2012


Hi Eli

You're right.  That would actually be ok, had i set up the chains for the dec to come from the load not the chain the load reads from.  But it might be more efficient to just not do this optimization in this case.  I'll change it to also check the count on the load.

Pete
On Feb 12, 2012, at 6:18 PM, Eli Friedman wrote:

> On Sun, Feb 12, 2012 at 4:10 PM, Pete Cooper <peter_cooper at apple.com> wrote:
>> Author: pete
>> Date: Sun Feb 12 18:10:03 2012
>> New Revision: 150356
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=150356&view=rev
>> Log:
>> Fixed bug when custom lowering DEC64m on x86.
>> 
>> If the DEC node had more than one user, it was doing this lowering but
>> leaving the original DEC node around and so decrementing twice.
>> 
>> Fixes PR11964.
>> 
>> Modified:
>>    llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
>>    llvm/trunk/test/CodeGen/X86/dec-eflags-lower.ll
>> 
>> Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=150356&r1=150355&r2=150356&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
>> +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Feb 12 18:10:03 2012
>> @@ -2378,6 +2378,7 @@
>>         Chain->getOpcode() != ISD::LOAD ||
>>         StoredVal->getOpcode() != X86ISD::DEC ||
>>         StoredVal.getResNo() != 0 ||
>> +        !StoredVal.getNode()->hasNUsesOfValue(1, 0) ||
>>         StoredVal->getOperand(0).getNode() != Chain.getNode())
>>       break;
> 
> Looking over the code, it looks like there might also be a missing
> check for the number of uses of the loaded value.
> 
> -Eli




More information about the llvm-commits mailing list