[LLVMdev] folding x * 0 = 0

Jochen Wilhelmy j.wilhelmy at arcor.de
Fri Mar 5 00:36:24 PST 2010


>
> I just wanted to point out that if x = inf the result of x * 0 is in 
> indeterminate form so reducing it to zero would give the wrong result 
> in that case.
Yes, thanks for the hint, but someone else already pointed out that 
nan*0 is also not 0.

I have a special application where inf and nan will not occur, therefore 
I will patch
my local llvm to optimize floats more aggressively.
If the result of 2.0 * 2.0 is between 3.9 and 4.1 this is sufficient for 
me if it's faster ;-)

-Jochen



More information about the llvm-dev mailing list