[all-commits] [llvm/llvm-project] 069ecd: [ARM] Check target feature support for __builtin_a...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Sep 21 11:50:31 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 069ecd0c6e2c9d5c457159d7326f31cba174e47c
      https://github.com/llvm/llvm-project/commit/069ecd0c6e2c9d5c457159d7326f31cba174e47c
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-09-21 (Wed, 21 Sep 2022)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsARM.def
    M clang/lib/Basic/Targets/ARM.cpp
    M clang/test/CodeGen/arm-crc32.c

  Log Message:
  -----------
  [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




More information about the All-commits mailing list