[LLVMdev] Clarifying FMA-related TargetOptions

Owen Anderson resistor at mac.com
Wed Feb 8 10:46:07 PST 2012

On Feb 8, 2012, at 10:42 AM, Hal Finkel wrote:
> In my experience, users of numerical codes expect that the compiler will
> use FMA instructions where it can, unless specifically asked to avoid
> doing so by the user. Even though this can sometimes produce a different
> result (*almost* always a better one), the performance gain is too large
> to be ignored by default. I highly recommend that we continue to enable
> FMA instruction-generation by default (as is the current practice, not
> only here, but in most vendor compilers with which I am familiar). We
> should also implement the FP_CONTRACT pragma, but that is another
> matter.

The caveat I would add to this is that, when I tried enabling FMA-by-default on an ARM target, I saw a large number of testcases in the LLVM test suite that either failed their output comparisons, crashed, or failed to terminate (!!!).  That seems pretty scary to me.


More information about the llvm-dev mailing list