[all-commits] [llvm/llvm-project] 489bda: [builtins] Only build float16/bfloat16 code if act...

Alexander Richardson via All-commits all-commits at lists.llvm.org
Wed Mar 8 06:59:06 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 489bda6a9c0ec9d2644b7bb0c230294d38f7296e
      https://github.com/llvm/llvm-project/commit/489bda6a9c0ec9d2644b7bb0c230294d38f7296e
  Author: Alex Richardson <alexrichardson at google.com>
  Date:   2023-03-08 (Wed, 08 Mar 2023)

  Changed paths:
    M compiler-rt/cmake/builtin-config-ix.cmake
    M compiler-rt/lib/builtins/CMakeLists.txt

  Log Message:
  -----------
  [builtins] Only build float16/bfloat16 code if actually supported

When building compiler-rt builtins for x86_64 they library will by default
also be built for i386. We unconditionally add the Float16 compile flags
since the check for Float16 support will be done using x86_64 compiler
flags, but i386 does not actually support it. Fix this by moving the
COMPILER_RT_HAS_FLOAT16 and COMPILER_RT_HAS_FLOAT16 checks to a
per-target-architecture check inside the loop (using
`check_c_source_compiles` and `cmake_{push,pop}_check_state`).

Many of the checks in the builtin-config-ix file should probably also be
changed to per-target-arch checks, but so far only the Float16 one has
caused issues. This is an alternative to D136044 which added a special case
for i386 FreeBSD.

Fixes: https://github.com/llvm/llvm-project/issues/57224
Differential Revision: https://reviews.llvm.org/D145237




More information about the All-commits mailing list