[PATCH] D136786: Fix `unsafe-fp-math` attribute emission.

Zahira Ammarguellat via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 28 08:40:02 PDT 2022


zahiraam added a comment.

>> I'm not following entirely, but -funsafe-math-optimizations is just a subset of -ffast-math, so checking only the properties that contribute to -funsafe-math-optimizations should be enough. 
>>  I think it is way simpler to reason in these terms than enumerating all the possible scenarios.

Exactly my point Since -funsafe-math-optimizations is a subset of -ffast-math, shouldn't it be the "minimal" option to trigger the unsafe-fp-math attribute for functions? 
I agree with the second part of the condition; it should be
updated with (LangOpts.getDefaultFPContractMode() ==  LangOptions::FPModeKind::FPM_Fast ||   LangOpts.getDefaultFPContractMode() == LangOptions::FPModeKind::FPM_FastHonorPragmas) 
but I am still hesitant about the change you are proposing for the first part of the condition.
@andrew.w.kaylor Can you please weigh in on this?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136786/new/

https://reviews.llvm.org/D136786



More information about the cfe-commits mailing list