[libc-commits] [libc] [libc][math] Optimize maximum and minimum functions using builtins when available (PR #100002)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Tue Jul 23 15:06:22 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `libc-riscv64-debian-fullbuild-dbg` running on `libc-riscv64-debian` while building `libc` at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/183/builds/1814

Here is the relevant piece of the build log for the reference:
```
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[28/3838] Building CXX object projects/libc/src/fenv/CMakeFiles/libc.src.fenv.feenableexcept.dir/feenableexcept.cpp.o
[29/3838] Building CXX object projects/libc/src/fenv/CMakeFiles/libc.src.fenv.fegetexcept.__internal__.dir/fegetexcept.cpp.o
[30/3838] Building CXX object projects/libc/src/fenv/CMakeFiles/libc.src.fenv.fedisableexcept.__internal__.dir/fedisableexcept.cpp.o
[31/3838] Building CXX object projects/libc/src/fenv/CMakeFiles/libc.src.fenv.fedisableexcept.dir/fedisableexcept.cpp.o
[32/3838] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxdiv.__internal__.dir/imaxdiv.cpp.o
[33/3838] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.strtoimax.__internal__.dir/strtoimax.cpp.o
[34/3838] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxabs.__internal__.dir/imaxabs.cpp.o
[35/3838] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.strtoumax.__internal__.dir/strtoumax.cpp.o
[36/3838] Building CXX object projects/libc/src/fenv/CMakeFiles/libc.src.fenv.fegetexcept.dir/fegetexcept.cpp.o
[37/3838] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__internal__.dir/canonicalize.cpp.o
FAILED: projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__internal__.dir/canonicalize.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_18_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/src/math/generic -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -D__LIBC_RISCV_USE_FMA -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter/usr/include -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -O3 -std=c++17 -MD -MT projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__internal__.dir/canonicalize.cpp.o -MF projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__internal__.dir/canonicalize.cpp.o.d -o projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__internal__.dir/canonicalize.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic/canonicalize.cpp
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic/canonicalize.cpp:10:
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:52:25: error: unknown type name 'float16'
template <> LIBC_INLINE float16 max(float16 x, float16 y) {
                        ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:52:37: error: unknown type name 'float16'
template <> LIBC_INLINE float16 max(float16 x, float16 y) {
                                    ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:52:48: error: unknown type name 'float16'
template <> LIBC_INLINE float16 max(float16 x, float16 y) {
                                               ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:53:10: error: use of undeclared identifier 'float16'
  FPBits<float16> x_bits(x);
         ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:54:10: error: use of undeclared identifier 'float16'
  FPBits<float16> y_bits(y);
         ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:90:25: error: unknown type name 'float16'
template <> LIBC_INLINE float16 min(float16 x, float16 y) {
                        ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:90:37: error: unknown type name 'float16'
template <> LIBC_INLINE float16 min(float16 x, float16 y) {
                                    ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:90:48: error: unknown type name 'float16'
template <> LIBC_INLINE float16 min(float16 x, float16 y) {
                                               ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:91:10: error: use of undeclared identifier 'float16'
  FPBits<float16> x_bits(x);
         ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:92:10: error: use of undeclared identifier 'float16'
  FPBits<float16> y_bits(y);
         ^
10 errors generated.
[38/3838] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__NO_FMA_OPT.__internal__.dir/canonicalize.cpp.o
FAILED: projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__NO_FMA_OPT.__internal__.dir/canonicalize.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_18_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/src/math/generic -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter/usr/include -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -O3 -std=c++17 -MD -MT projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__NO_FMA_OPT.__internal__.dir/canonicalize.cpp.o -MF projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__NO_FMA_OPT.__internal__.dir/canonicalize.cpp.o.d -o projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__NO_FMA_OPT.__internal__.dir/canonicalize.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic/canonicalize.cpp
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic/canonicalize.cpp:10:
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:52:25: error: unknown type name 'float16'
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[28/3838] Building CXX object projects/libc/src/fenv/CMakeFiles/libc.src.fenv.feenableexcept.dir/feenableexcept.cpp.o
[29/3838] Building CXX object projects/libc/src/fenv/CMakeFiles/libc.src.fenv.fegetexcept.__internal__.dir/fegetexcept.cpp.o
[30/3838] Building CXX object projects/libc/src/fenv/CMakeFiles/libc.src.fenv.fedisableexcept.__internal__.dir/fedisableexcept.cpp.o
[31/3838] Building CXX object projects/libc/src/fenv/CMakeFiles/libc.src.fenv.fedisableexcept.dir/fedisableexcept.cpp.o
[32/3838] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxdiv.__internal__.dir/imaxdiv.cpp.o
[33/3838] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.strtoimax.__internal__.dir/strtoimax.cpp.o
[34/3838] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxabs.__internal__.dir/imaxabs.cpp.o
[35/3838] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.strtoumax.__internal__.dir/strtoumax.cpp.o
[36/3838] Building CXX object projects/libc/src/fenv/CMakeFiles/libc.src.fenv.fegetexcept.dir/fegetexcept.cpp.o
[37/3838] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__internal__.dir/canonicalize.cpp.o
FAILED: projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__internal__.dir/canonicalize.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_18_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/src/math/generic -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -D__LIBC_RISCV_USE_FMA -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter/usr/include -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -O3 -std=c++17 -MD -MT projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__internal__.dir/canonicalize.cpp.o -MF projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__internal__.dir/canonicalize.cpp.o.d -o projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__internal__.dir/canonicalize.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic/canonicalize.cpp
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic/canonicalize.cpp:10:
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:52:25: error: unknown type name 'float16'
template <> LIBC_INLINE float16 max(float16 x, float16 y) {
                        ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:52:37: error: unknown type name 'float16'
template <> LIBC_INLINE float16 max(float16 x, float16 y) {
                                    ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:52:48: error: unknown type name 'float16'
template <> LIBC_INLINE float16 max(float16 x, float16 y) {
                                               ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:53:10: error: use of undeclared identifier 'float16'
  FPBits<float16> x_bits(x);
         ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:54:10: error: use of undeclared identifier 'float16'
  FPBits<float16> y_bits(y);
         ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:90:25: error: unknown type name 'float16'
template <> LIBC_INLINE float16 min(float16 x, float16 y) {
                        ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:90:37: error: unknown type name 'float16'
template <> LIBC_INLINE float16 min(float16 x, float16 y) {
                                    ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:90:48: error: unknown type name 'float16'
template <> LIBC_INLINE float16 min(float16 x, float16 y) {
                                               ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:91:10: error: use of undeclared identifier 'float16'
  FPBits<float16> x_bits(x);
         ^
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:92:10: error: use of undeclared identifier 'float16'
  FPBits<float16> y_bits(y);
         ^
10 errors generated.
[38/3838] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__NO_FMA_OPT.__internal__.dir/canonicalize.cpp.o
FAILED: projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__NO_FMA_OPT.__internal__.dir/canonicalize.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_18_0_0_git -D_DEBUG -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/src/math/generic -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic -I/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/build/projects/libc/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -idirafter/usr/include -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -O3 -std=c++17 -MD -MT projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__NO_FMA_OPT.__internal__.dir/canonicalize.cpp.o -MF projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__NO_FMA_OPT.__internal__.dir/canonicalize.cpp.o.d -o projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.canonicalize.__NO_FMA_OPT.__internal__.dir/canonicalize.cpp.o -c /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic/canonicalize.cpp
In file included from /home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/math/generic/canonicalize.cpp:10:
/home/libc_worker/libc-riscv64-debian/libc-riscv64-debian-fullbuild-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:52:25: error: unknown type name 'float16'

```

https://github.com/llvm/llvm-project/pull/100002


More information about the libc-commits mailing list