[clang] [llvm] [IR] Don't set strictfp on irrelevant calls (PR #122735)
Andy Kaylor via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 21 13:12:14 PST 2025
andykaylor wrote:
> > My understanding of the attribute is that it only indicates that strict floating-point semantics are (potentially?) required at the call site.
>
> If strict floating-point semantics are required at this call site, they are are required on every relevant call in this function. It means `strictfp` is a function attribute. Does anything prevents us from removal `strictfp` from all call sites?
I think that takes us back to @kpneal's history, "Then we found that basic blocks were being optimized when they didn't belong to a function so we couldn't get to the where the strictfp attribute was located. The solution was to add the attribute to every function call." To handle the case where a block isn't owned by a function, we need the attribute at the call site. I don't know the specifics of how that case arises, but if we remove the attribute from the call site, we would have to do something to add it again when the block gets detached from the function (possibly during cloning?).
https://github.com/llvm/llvm-project/pull/122735
More information about the llvm-commits
mailing list