[clang] [Clang][CodeGen] Lookup standard library declarations for builtins to… (PR #204792)
James Y Knight via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 23 07:07:37 PDT 2026
jyknight wrote:
> ```
> ; Function Attrs: nounwind optsize
> define dso_local float @f(float noundef %0, float noundef %1) local_unnamed_addr #0 {
> %3 = tail call float @_hypotf(float noundef %0, float noundef %1) #2, !inline_history !6
> ret float %3
> }
>
> ; Function Attrs: optsize
> declare dllimport float @_hypotf(float noundef, float noundef) local_unnamed_addr #1
> ```
This example shows something completely different than the PR description implies, and makes the proposed fix seem even less valid.
This demonstrates that "hypotf" is defined as an _inline function_ in MS CRT's math.h header, NOT as a dllimport function. The inline "hypotf" function simply calls the external (dllimport) `_hypotf` -- and that's what you see in this IR snippet, because it's post-inlining.
https://github.com/llvm/llvm-project/pull/204792
More information about the cfe-commits
mailing list