diff options
author | Justin Lebar <jlebar@google.com> | 2017-01-10 23:43:04 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2017-01-10 23:43:04 +0000 |
commit | 7d81813d76ded4b84456f18f01b43424c7e6d57d (patch) | |
tree | 4a365de86b6f19fec247f6ee2df178b7979a5962 /llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp | |
parent | c1e2d97a2cd8a58db1d064de7934f0212f3c9511 (diff) | |
download | bcm5719-llvm-7d81813d76ded4b84456f18f01b43424c7e6d57d.tar.gz bcm5719-llvm-7d81813d76ded4b84456f18f01b43424c7e6d57d.zip |
[TM] Restore default TargetOptions in TargetMachine::resetTargetOptions.
Summary:
Previously if you had
* a function with the fast-math-enabled attr, followed by
* a function without the fast-math attr,
the second function would inherit the first function's fast-math-ness.
This means that mixing fast-math and non-fast-math functions in a module
was completely broken unless you explicitly annotated every
non-fast-math function with "unsafe-fp-math"="false". This appears to
have been broken since r176986 (March 2013), when the resetTargetOptions
function was introduced.
This patch tests the correct behavior as best we can. I don't think I
can test FPDenormalMode and NoTrappingFPMath, because they aren't used
in any backends during function lowering. Surprisingly, I also can't
find any uses at all of LessPreciseFPMAD affecting generated code.
The NVPTX/fast-math.ll test changes are an expected result of fixing
this bug. When FMA is disabled, we emit add as "add.rn.f32", which
prevents fma combining. Before this patch, fast-math was enabled in all
functions following the one which explicitly enabled it on itself, so we
were emitting plain "add.f32" where we should have generated
"add.rn.f32".
Reviewers: mkuper
Subscribers: hfinkel, majnemer, jholewinski, nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D28507
llvm-svn: 291618
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp')
0 files changed, 0 insertions, 0 deletions