Improve Fast-Math mode for LLVM (mono/mono#16599)
authorEgor Bogatov <egorbo@gmail.com>
Tue, 3 Sep 2019 12:19:03 +0000 (15:19 +0300)
committerSteve Pfister <steveisok@users.noreply.github.com>
Tue, 3 Sep 2019 12:19:03 +0000 (08:19 -0400)
commit5152ce44cb3b980080043742f2559b8f1872fd09
treea6ccb9652a09652b97c3e9ae856a63c73bbe9379
parentd7157499dc8cf55559e0c1a2a0bc8bf40eee7672
Improve Fast-Math mode for LLVM (mono/mono#16599)

It turns out it's not enough to set global fast math parameters, it's also required to mark some instructions as "fast" (see https://llvm.org/docs/LangRef.html#fast-math-flags) like, for instance, clang does, see https://godbolt.org/z/U8TFST
E.g. all optimizations inside SimplifyLibCalls pass (it's a subpass of InstCombine) need it.

Commit migrated from https://github.com/mono/mono/commit/416a31796e6a34a134d251760c6055bacc39878c
src/mono/mono/mini/mini-llvm-cpp.cpp
src/mono/mono/mini/mini-llvm-cpp.h
src/mono/mono/mini/mini-llvm.c
src/mono/netcore/Makefile