[llvm-dev] [FP] Constant folding math library functions
Troy Johnson via llvm-dev
llvm-dev at lists.llvm.org
Wed Apr 17 14:20:07 PDT 2019
> -----Original Message-----
> From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Joerg
> Sonnenberger via llvm-dev
> Sent: Wednesday, April 17, 2019 4:05 PM
> To: llvm-dev at lists.llvm.org
> Subject: Re: [llvm-dev] [FP] Constant folding math library functions
> Using MPFR doesn't solve anything, in fact it will often be worse as it won't
> agree with even the native libm.
That depends on your goal. If your goal is to match the native libm, then it doesn't help. If your goal is to ensure that the compiler's folds are at least as precise as the native libm, then it helps. In other words, people generally don't complain if a compiler folds with greater precision than a runtime call, but if the compiler folds with less precision then they will be upset.
More information about the llvm-dev