[llvm-commits] [llvm] r62789 - in /llvm/trunk: lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp test/CodeGen/X86/negate-add-zero.ll

Dan Gohman gohman at apple.com
Thu Jan 22 15:48:17 PST 2009


On Jan 22, 2009, at 2:38 PM, Chris Lattner wrote:

>
> On Jan 22, 2009, at 1:58 PM, Dan Gohman wrote:
>
>> Author: djg
>> Date: Thu Jan 22 15:58:43 2009
>> New Revision: 62789
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=62789&view=rev
>> Log:
>> Don't create ISD::FNEG nodes after legalize if they aren't legal.
>>
>> Simplify x+0 to x in unsafe-fp-math mode. This avoids a bunch of
>> redundant work in many cases, because in unsafe-fp-math mode,
>> ISD::FADD with a constant is considered free to negate, so the
>> DAGCombiner often negates x+0 to -0-x thinking it's free, when
>> in reality the end result is -x, which is more expensive than x.
>>
>> Also, combine x*0 to 0.
>>
>> This fixes PR3374.
>
> awesome, thanks Dan!  Can you please use the 'more reduced' testcase
> in the PR, just to reduce the test size?

Hi Chris, the larger testcase actually has more interesting cases
in it than the 'more reduced' one.

Dan




More information about the llvm-commits mailing list