Skip to content
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

ARM: error in backend: Cannot select: intrinsic %llvm.arm.hint #56581

Open
AdrianBunk opened this issue Jul 17, 2022 · 1 comment
Open

ARM: error in backend: Cannot select: intrinsic %llvm.arm.hint #56581

AdrianBunk opened this issue Jul 17, 2022 · 1 comment

Comments

@AdrianBunk
Copy link

AdrianBunk commented Jul 17, 2022

Reduced testcase for https://bugs.debian.org/1005871 for the code in https://github.com/google/filament/blob/main/libs/utils/include/utils/compiler.h#L188

$ cat test.c
void a() { __builtin_arm_sev(); }
$ clang -c --target=arm -mcpu=arm946e-s -mfloat-abi=soft test.c
fatal error: error in backend: Cannot select: intrinsic %llvm.arm.hint
...

The bug exists at least with LLVM versions 11-14 from Debian unstable (other versions were not tested).

Note that this is an armv5 CPU where the instruction in question does not exist, using -mcpu=cortex-a9 instead works and emits the instruction.

https://developer.arm.com/documentation/101028/0012/7--Synchronization--barrier--and-hint-intrinsics

The intrinsics in this section are available for all targets. They may be no-ops (i.e. generate no code, but possibly act as a code motion barrier in compilers) on targets where the relevant instructions do not exist.

The frontend is correct in accepting __builtin_arm_sev() despite the instruction not existing, but treating it as a no-op in the backend seems to go wrong or is not implemented.

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 17, 2022

@llvm/issue-subscribers-backend-arm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants