[llvm] [CodeGen] Provide `MachineFunction::hasUnsafeFPMath` (PR #127488)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 18 10:47:00 PST 2025
================
@@ -699,6 +699,11 @@ bool MachineFunction::needsFrameMoves() const {
!F.getParent()->debug_compile_units().empty();
}
+/// True if function attribute unsafe-fp-math is true.
+bool MachineFunction::hasUnsafeFPMath() const {
+ return F.getFnAttribute("unsafe-fp-math").getValueAsBool();
----------------
Artem-B wrote:
Does `--enable-unsafe-fp-math` currently set `unsafe-fp-math` on all functions?
If it does not, then the change will likely affect performance, as unsafe math will only enable unsafe optimizations in explicitly marked functions only. Ignoring global `Options.UnsafeFPMath` may not be the best idea.
> break some tests.
Can you elaborate on which tests failed and how. It's possible that it's those tests that should be fixed, instead.
https://github.com/llvm/llvm-project/pull/127488
More information about the llvm-commits
mailing list