[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:45:48 PDT 2024


llvm-ci wrote:

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

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

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)
...
[18/321] Building CXX object projects/libc/src/fenv/CMakeFiles/libc.src.fenv.fegetexcept.dir/fegetexcept.cpp.o
[19/321] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.strtoimax.dir/strtoimax.cpp.o
[20/321] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.strtoumax.dir/strtoumax.cpp.o
[21/321] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxdiv.dir/imaxdiv.cpp.o
[22/321] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxabs.dir/imaxabs.cpp.o
[23/321] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.ceilf.dir/ceilf.cpp.o
[24/321] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.ceil.dir/ceil.cpp.o
[25/321] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.ceill.dir/ceill.cpp.o
[26/321] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.dsqrtl.dir/dsqrtl.cpp.o
[27/321] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cosf.dir/cosf.cpp.o
FAILED: projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cosf.dir/cosf.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -D_DEBUG -I/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/build/projects/libc/src/math/generic -I/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/math/generic -I/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc -isystem /llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -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 -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 -DLIBC_COPT_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cosf.dir/cosf.cpp.o -MF projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cosf.dir/cosf.cpp.o.d -o projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cosf.dir/cosf.cpp.o -c /llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/math/generic/cosf.cpp
In file included from /llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/math/generic/cosf.cpp:11:
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-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) {
                        ^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-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) {
                                    ^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-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) {
                                               ^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:53:10: error: use of undeclared identifier 'float16'; did you mean 'float'?
  FPBits<float16> x_bits(x);
         ^~~~~~~
         float
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:53:17: error: expected '(' for function-style cast or type construction
  FPBits<float16> x_bits(x);
         ~~~~~~~^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:54:10: error: use of undeclared identifier 'float16'; did you mean 'float'?
  FPBits<float16> y_bits(y);
         ^~~~~~~
         float
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:54:17: error: expected '(' for function-style cast or type construction
  FPBits<float16> y_bits(y);
         ~~~~~~~^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-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) {
                        ^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-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) {
                                    ^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-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) {
                                               ^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:91:10: error: use of undeclared identifier 'float16'; did you mean 'float'?
  FPBits<float16> x_bits(x);
         ^~~~~~~
         float
Step 6 (build libc) failure: build libc (failure)
...
[18/321] Building CXX object projects/libc/src/fenv/CMakeFiles/libc.src.fenv.fegetexcept.dir/fegetexcept.cpp.o
[19/321] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.strtoimax.dir/strtoimax.cpp.o
[20/321] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.strtoumax.dir/strtoumax.cpp.o
[21/321] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxdiv.dir/imaxdiv.cpp.o
[22/321] Building CXX object projects/libc/src/inttypes/CMakeFiles/libc.src.inttypes.imaxabs.dir/imaxabs.cpp.o
[23/321] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.ceilf.dir/ceilf.cpp.o
[24/321] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.ceil.dir/ceil.cpp.o
[25/321] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.ceill.dir/ceill.cpp.o
[26/321] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.dsqrtl.dir/dsqrtl.cpp.o
[27/321] Building CXX object projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cosf.dir/cosf.cpp.o
FAILED: projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cosf.dir/cosf.cpp.o 
/usr/bin/clang++ -DLIBC_NAMESPACE=__llvm_libc_19_0_0_git -D_DEBUG -I/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/build/projects/libc/src/math/generic -I/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/math/generic -I/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc -isystem /llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/build/projects/libc/include -fPIC -fno-semantic-interposition -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 -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 -DLIBC_COPT_PUBLIC_PACKAGING -std=c++17 -MD -MT projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cosf.dir/cosf.cpp.o -MF projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cosf.dir/cosf.cpp.o.d -o projects/libc/src/math/generic/CMakeFiles/libc.src.math.generic.cosf.dir/cosf.cpp.o -c /llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/math/generic/cosf.cpp
In file included from /llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/math/generic/cosf.cpp:11:
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-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) {
                        ^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-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) {
                                    ^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-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) {
                                               ^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:53:10: error: use of undeclared identifier 'float16'; did you mean 'float'?
  FPBits<float16> x_bits(x);
         ^~~~~~~
         float
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:53:17: error: expected '(' for function-style cast or type construction
  FPBits<float16> x_bits(x);
         ~~~~~~~^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:54:10: error: use of undeclared identifier 'float16'; did you mean 'float'?
  FPBits<float16> y_bits(y);
         ^~~~~~~
         float
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:54:17: error: expected '(' for function-style cast or type construction
  FPBits<float16> y_bits(y);
         ~~~~~~~^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-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) {
                        ^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-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) {
                                    ^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-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) {
                                               ^
/llvm/libc_worker/worker/libc-arm32-debian/libc-arm32-debian-dbg/llvm-project/libc/src/__support/FPUtil/BasicOperations.h:91:10: error: use of undeclared identifier 'float16'; did you mean 'float'?
  FPBits<float16> x_bits(x);
         ^~~~~~~
         float

```

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


More information about the libc-commits mailing list