> Is x*0 => 0 true if isnan(x)? >then where do I have to add it if I want to make it a non-standard modification of my local llvm version? would it make sense to add a subset of float to llvm or a kind of modifier (e.g. valid float to indicate that it is always valid and not nan) to allow more aggressive optimization? just like e.g. inbounds for load -Jochen
On Mar 3, 2010, at 9:32 AM, Jochen Wilhelmy wrote:> >> Is x*0 => 0 true if isnan(x)? >> > then where do I have to add it if I want to make it a non-standard > modification > of my local llvm version? > would it make sense to add a subset of float to llvm or a kind of modifier > (e.g. valid float to indicate that it is always valid and not nan) to > allow more aggressive optimization? > just like e.g. inbounds for loadYou should check out the -enable-finite-only-fp-math and -enable-unsafe-fp-math options.
> You should check out the -enable-finite-only-fp-math and -enable-unsafe-fp-math options.Good hint, but llvm::UnsafeFPMath = true; llvm::FiniteOnlyFPMathOption = true; at the beginning of my code does not help. I found llvm::Reassociate::OptimizeExpression in llvm\lib\Transforms\Scalar\Reassociate.cpp which looks like it does X * 0 = 0 for int, but it does not get called for int, but it works for int. -Jochen