-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 |
…te fma instructions. (#124200) Fixes llvm/llvm-project#123387
…or __builtin_fma* to generate fma instructions. (#124200) Fixes llvm/llvm-project#123387 GitOrigin-RevId: 47a46c9da8c911f951bbc979f0b31bb4705e24da Original-Revision: 4c7924433f6ce1e9343a94c11139a1ad1e74fa1b Roller-URL: https://cr-buildbucket.appspot.com/build/8724889844667415329 CQ-Do-Not-Cancel-Tryjobs: true Change-Id: Ifc9df381dd10512bebb738fb0752ff5f6ee2f2db Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1192714
…ltin_fma* to generate fma instructions. (#124200) Fixes llvm/llvm-project#123387 GitOrigin-RevId: 47a46c9da8c911f951bbc979f0b31bb4705e24da Original-Revision: 4c7924433f6ce1e9343a94c11139a1ad1e74fa1b Change-Id: I9ffb4627ed2350df101bc1f9d222785f4e30ab00
…-fno-math-errno to for __builtin_fma* to generate fma instructions. (#124200) Fixes llvm/llvm-project#123387 GitOrigin-RevId: 8b8370bf031ebb9fb78e960e97f189212d191acb Original-Revision: 4c7924433f6ce1e9343a94c11139a1ad1e74fa1b Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1192714 Original-Revision: caea7397c036f6f9caa5996620f598445d2d3103 Change-Id: Ic1b0b752966ee2c5fc8210afdd234fd9a51baac0
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: