[LLVMdev] folding x * 0 = 0

Jochen Wilhelmy j.wilhelmy at arcor.de
Wed Mar 3 10:23:52 PST 2010


> 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




More information about the llvm-dev mailing list