[clang] [llvm] [clang] Add tanf16 builtin and support for tan constrained intrinsic (PR #93314)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Wed May 29 11:54:38 PDT 2024


ilovepi wrote:

Hi, we're seeing a codegen issue building Fuchsia after this patch.  I'm looking now, but so far I'm not sure why this is happening. Would you mind taking a look?

Error:
```
FAILED: obj/src/graphics/lib/compute/spinel/ext/transform_stack/transform_stack.transform_stack.c.o 
../../prebuilt/third_party/clang/custom/bin/clang -MD -MF obj/src/graphics/lib/compute/spinel/ext/transform_stack/transform_stack.transform_stack.c.o.d -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -DNDEBUG=1 -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -I../.. -Igen -I../../src/graphics/lib/compute/spinel/include -I../../src/graphics/lib/compute -fcolor-diagnostics -fcrash-diagnostics-dir=clang-crashreports -fcrash-diagnostics=all -gen-reproducer=error -ffp-contract=off --sysroot=gen/zircon/public/sysroot/cpp --target=x86_64-unknown-fuchsia -ffuchsia-api-level=4293918720 -march=x86-64-v2 -mtune=generic -mbranches-within-32B-boundaries -ffile-compilation-dir=. -no-canonical-prefixes -fomit-frame-pointer -fdata-sections -ffunction-sections -Os -flto -mllvm -wholeprogramdevirt-branch-funnel-threshold=0 -ffat-lto-objects -Xclang -debug-info-kind=constructor -g3 -grecord-gcc-switches -gdwarf-5 -gz=zstd -Wall -Wextra -Wconversion -Wextra-semi -Wimplicit-fallthrough -Wnewline-eof -Wstrict-prototypes -Wwrite-strings -Wno-sign-conversion -Wno-unused-parameter -Wnonportable-system-include-path -Wno-missing-field-initializers -Wno-extra-qualification -Wno-cast-function-type-strict -Wno-cast-function-type-mismatch -Wno-unknown-warning-option -Wno-deprecated-pragma -fvisibility=hidden -Werror -Wa,--fatal-warnings -ftrivial-auto-var-init=pattern -Wthread-safety -Wno-unknown-warning-option -Wno-thread-safety-reference-return -std=c11 -c ../../src/graphics/lib/compute/spinel/ext/transform_stack/transform_stack.c -o obj/src/graphics/lib/compute/spinel/ext/transform_stack/transform_stack.transform_stack.c.o
fatal error: error in backend: Cannot select: intrinsic %llvm.tan
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: ../../prebuilt/third_party/clang/custom/bin/clang -MD -MF obj/src/graphics/lib/compute/spinel/ext/transform_stack/transform_stack.transform_stack.c.o.d -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -DNDEBUG=1 -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -I../.. -Igen -I../../src/graphics/lib/compute/spinel/include -I../../src/graphics/lib/compute -fcolor-diagnostics -fcrash-diagnostics-dir=clang-crashreports -fcrash-diagnostics=all -gen-reproducer=error -ffp-contract=off --sysroot=gen/zircon/public/sysroot/cpp --target=x86_64-unknown-fuchsia -ffuchsia-api-level=4293918720 -march=x86-64-v2 -mtune=generic -mbranches-within-32B-boundaries -ffile-compilation-dir=. -no-canonical-prefixes -fomit-frame-pointer -fdata-sections -ffunction-sections -Os -flto -mllvm -wholeprogramdevirt-branch-funnel-threshold=0 -ffat-lto-objects -Xclang -debug-info-kind=constructor -g3 -grecord-gcc-switches -gdwarf-5 -gz=zstd -Wall -Wextra -Wconversion -Wextra-semi -Wimplicit-fallthrough -Wnewline-eof -Wstrict-prototypes -Wwrite-strings -Wno-sign-conversion -Wno-unused-parameter -Wnonportable-system-include-path -Wno-missing-field-initializers -Wno-extra-qualification -Wno-cast-function-type-strict -Wno-cast-function-type-mismatch -Wno-unknown-warning-option -Wno-deprecated-pragma -fvisibility=hidden -Werror -Wa,--fatal-warnings -ftrivial-auto-var-init=pattern -Wthread-safety -Wno-unknown-warning-option -Wno-thread-safety-reference-return -std=c11 -c ../../src/graphics/lib/compute/spinel/ext/transform_stack/transform_stack.c -o obj/src/graphics/lib/compute/spinel/ext/transform_stack/transform_stack.transform_stack.c.o
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module '../../src/graphics/lib/compute/spinel/ext/transform_stack/transform_stack.c'.
4.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@spinel_transform_stack_push_skew_x'
#0 0x0000558e5225bc78 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (../../prebuilt/third_party/clang/custom/bin/clang+0x8936c78)
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Fuchsia clang version 19.0.0git (https://llvm.googlesource.com/llvm-project 1de6011c34b185235cd65c2e3fb030015d182968)
Target: x86_64-unknown-fuchsia
Thread model: posix
InstalledDir: ../../prebuilt/third_party/clang/custom/bin
Build config: +assertions
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: clang-crashreports/transform_stack-afeed7.c
clang: note: diagnostic msg: clang-crashreports/transform_stack-afeed7.sh
clang: note: diagnostic msg: 
```

Failing Bot:  https://ci.chromium.org/ui/p/fuchsia/builders/ci/clang_toolchain.ci.core.x64-release-subbuild/b8746589504792556897/overview

Logs: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8746589504792556897/+/u/build/ninja/stdout

Reproducer from bot: https://storage.googleapis.com/fuchsia-artifacts/builds/8746589527028907233/build-debug/clang-crashreports/transform_stack-afeed7.tar

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


More information about the cfe-commits mailing list