Hi! in visitFAdd I found this comment: // Check for X+0.0. Simplify it to X if we know X is not -0.0. Why is it not allowed to simplify X + 0.0 = X when X may be -0.0? Because -0.0 + 0.0 is 0.0 and not -0.0? For me it would be great if strict floating point processing could be switched off (also for X * 0.0 = 0.0). -Jochen
On Jul 24, 2010, at 2:59 AMPDT, Jochen Wilhelmy wrote:> Hi! > > in visitFAdd I found this comment: > > // Check for X+0.0. Simplify it to X if we know X is not -0.0. > > Why is it not allowed to simplify X + 0.0 = X when X may be > -0.0? Because -0.0 + 0.0 is 0.0 and not -0.0? > > For me it would be great if strict floating point processing could > be switched off (also for X * 0.0 = 0.0).The DAGCombiner appears to do both of these with -enable-unsafe-fp- math .
> > The DAGCombiner appears to do both of these with -enable-unsafe-fp-math . >But isn't the DAGCombiner a part of the back-end? Is it possible to get llvm ir out of the DAGCombiner? Do you mean the SelectionDAG? I further process llvm ir and therefore need a "best possible" optimization on llvm ir. -Jochen