Skip to content
Commit 069ecd0c authored by Fangrui Song's avatar Fangrui Song
Browse files

[ARM] Check target feature support for __builtin_arm_crc*

`__builtin_arm_crc*` requires the target feature crc which is available on armv8
and above. Calling the fuctions for armv7 leads to a SelectionDAG crash.

```
% clang -c --target=armv7-unknown-linux-gnueabi -c a.c
fatal error: error in backend: Cannot select: intrinsic %llvm.arm.crc32b
PLEASE submit a bug report to ...
```

Add `TARGET_BUILTIN` and define required features for these builtins to
report an error in `CodeGenFunction::checkTargetFeatures`. The problem is quite widespread.
I will add `TARGET_BUILTIN` for more builtins later.

Fix https://github.com/llvm/llvm-project/issues/57802

Differential Revision: https://reviews.llvm.org/D134127
parent 552539bd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment