[LLVMdev] Optimize away sqrt in simple cases?
resistor at mac.com
Wed Apr 24 00:41:17 PDT 2013
On Apr 24, 2013, at 12:36 AM, Stephen Lin <swlin at post.harvard.edu> wrote:
> By the way, I definitely believe you that this isn't a 100% safe
> optimization, but I'm curious, is this really guaranteed here that c
> will not be a non-zero finite value? I was under the impression that
> FPU state could lead to slightly different results in these kinds of
> cases, so one should almost never rely on the result of a computation
> being exactly zero (outside of some simple primitive cases).
That's a common misconception. Floating point computations are deterministic and a function only of their inputs (and a couple of modal switches like rounding mode).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev