-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fmaf
is an empty unreachable function with optimizations on cortex-m33
#123387
Comments
@llvm/issue-subscribers-bug Author: None (PiJoules)
The generic `fmaf` implementation in llvm-libc is
On cortex-m33,
However, clang replaces the
Since
and since the entire function is
It seems either (1) clang is incorrectly lowering the This can be reproduced by building armv8m.main-unknown-none-eabi runtimes from the fuchsia cache file. Alternatively, the fma.cpp code expands to
which can be compiled with
|
@llvm/issue-subscribers-libc Author: None (PiJoules)
The generic `fmaf` implementation in llvm-libc is
On cortex-m33,
However, clang replaces the
Since
and since the entire function is
It seems either (1) clang is incorrectly lowering the This can be reproduced by building armv8m.main-unknown-none-eabi runtimes from the fuchsia cache file. Alternatively, the fma.cpp code expands to
which can be compiled with
|
I believe for the short term, we can replace the For the long term, it might be useful to have an audit of all the |
The generic
fmaf
implementation in llvm-libc isOn cortex-m33,
fputil::fma<float>
isHowever, clang replaces the
__builtin_fmaf
call with a call to a normalfmaf
at-O0
Since
fmaf
just callsfputil::fma<float>
, we end up with mutual recursion. With-Os
or-O3
, clang removes the function body forfmaf
and since the entire function is
unreachable
, this just ends up becoming an empty functionIt seems either (1) clang is incorrectly lowering the
__builtin_fmaf
tofmaf
or (2) llvm-libc should have tighter checks on ensuring that a builtin call won't be lowered to a libcall. I would assume this shouldn't be lowered to a libcall in the first place since__ARM_FEATURE_FMA
is defined, but perhaps it might be permissible for any compiler to lower a builtin call to a normal function call?This can be reproduced by building armv8m.main-unknown-none-eabi runtimes from the fuchsia cache file. Alternatively, the fma.cpp code expands to
which can be compiled with
The text was updated successfully, but these errors were encountered: