[LLVMdev] Floating point optimizations
Dale Johannesen
dalej at apple.com
Tue Aug 5 11:44:04 PDT 2008
On Aug 5, 2008, at 10:18 AMPDT, Brendan Younger wrote:
> Hi,
>
> I have some code which relies on the floating point rounding mode to
> be set to round-to-negative-infinity. This means that there are some
> floating point optimizations which are legal with the default round-
> to-
> nearest mode but not with rounding to negative infinity. Does LLVM
> reorder or otherwise optimize floating point operations? I've looked
> at the options for "opt" but don't see anything to do with floating
> point so I assume no.
The intent is that it does optimizations as permitted by IEEE754
(i.e. negative zeroes, NaNs, and infinities should be handled
correctly), and more aggressive ones with --enable-unsafe-fp-math (you
don't want this). However we are not modelling the rounding mode
yet, so it's likely this doesn't fully work as you want. Rounding
mode handling is something we want to add, but so far there have
always been more important things.
More information about the llvm-dev
mailing list