[llvm-commits] [llvm] r108639 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Chris Lattner clattner at apple.com
Sun Jul 18 11:46:16 PDT 2010


On Jul 18, 2010, at 11:21 AM, Owen Anderson wrote:

> 
> On Jul 18, 2010, at 10:50 AM, Chris Lattner wrote:
> 
>> 
>> On Jul 18, 2010, at 1:47 AM, Owen Anderson wrote:
>> 
>>> Author: resistor
>>> Date: Sun Jul 18 03:47:54 2010
>>> New Revision: 108639
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=108639&view=rev
>>> Log:
>>> Add a DAGCombine xform to fold away redundant float->double->float conversions around sqrt instructions.
>>> I am assured by people more knowledgeable than me that there are no rounding issues in eliminating this.
>>> 
>>> This fixed <rdar://problem/8197504>.
>> 
>> Why a dag combine?  I thought that instcombine or simplifylibcalls already did this?  Doing this in the optimizer exposes other opportunities (e.g. when it is cross-block).
> 
> The code this comes from is of the form:
> 
> double foo(double x) {
>  return sqrt(x);
> }

The code in the radar is:

	#include <math.h>
	float foo(float x) {
	    return sqrt(x);
	}

which is float/float.

-Chris



More information about the llvm-commits mailing list