Skip to content

SPIR-V Expected scalar FFREXP/FMODF to expand to libcall after WW13 2025 pulldown #17813

Open
@jsji

Description

@jsji

Describe the bug

SYCL :: DeviceLib/cmath_test.cpp
SYCL :: DeviceLib/math_fp64_test.cpp
SYCL :: DeviceLib/math_test.cpp

cmath_fp64_test.cpp failing with LLVM SPIRV backend.

To reproduce

********************
FAIL: SYCL :: DeviceLib/cmath_test.cpp (1009 of 2326)
******************** TEST 'SYCL :: DeviceLib/cmath_test.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 3
/__w/llvm/llvm/toolchain/bin/clang++  -Werror -fsycl -fsycl-targets=nvptx64-nvidia-cuda,amdgcn-amd-amdhsa,spir64 -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx1030 -fsycl-use-spirv-backend-for-spirv-gen -Wno-unused-command-line-argument  /__w/llvm/llvm/llvm/sycl/test-e2e/DeviceLib/cmath_test.cpp -fno-builtin -fno-fast-math -o /__w/llvm/llvm/build-e2e/DeviceLib/Output/cmath_test.cpp.tmp1.out
# executed command: /__w/llvm/llvm/toolchain/bin/clang++ -Werror -fsycl -fsycl-targets=nvptx64-nvidia-cuda,amdgcn-amd-amdhsa,spir64 -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx1030 -fsycl-use-spirv-backend-for-spirv-gen -Wno-unused-command-line-argument /__w/llvm/llvm/llvm/sycl/test-e2e/DeviceLib/cmath_test.cpp -fno-builtin -fno-fast-math -o /__w/llvm/llvm/build-e2e/DeviceLib/Output/cmath_test.cpp.tmp1.out
# .---command stderr------------
# | Expected scalar FFREXP/FMODF to expand to libcall!
# | UNREACHABLE executed at /__w/llvm/llvm/src/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:4627!
# | PLEASE submit a bug report to https://github.com/intel/llvm/issues and include the crash backtrace, preprocessed source, and associated run script.
# | Stack dump:
# | 0.	Program arguments: /__w/llvm/llvm/toolchain/bin/clang-21 -cc1 -triple nvptx64-nvidia-cuda -aux-triple x86_64-unknown-linux-gnu -fsycl-is-device -fdeclare-spirv-builtins -O2 -fenable-sycl-dae -Wno-sycl-strict -O2 -fsycl-int-header=/tmp/lit-tmp-2wgf867m/cmath_test-header-4f12e8.h -fsycl-int-footer=/tmp/lit-tmp-2wgf867m/cmath_test-footer-bcf7cd.h -D__SYCL_TARGET_NVIDIA_GPU_SM_50__ -sycl-std=2020 -fsycl-unique-prefix=uid87e15114e7b1f320 -D__SYCL_ANY_DEVICE_HAS_ANY_ASPECT__=1 -S -dumpdir /__w/llvm/llvm/build-e2e/DeviceLib/Output/cmath_test.cpp.tmp1.out- -disable-free -clear-ast-before-backend -main-file-name cmath_test.cpp -mrelocation-model static -mframe-pointer=all -ffp-contract=on -fno-rounding-math -no-integrated-as -aux-target-cpu x86-64 -internal-isystem /__w/llvm/llvm/toolchain/bin/../include/sycl/stl_wrappers -internal-isystem /__w/llvm/llvm/toolchain/bin/../include -mlink-builtin-bitcode /__w/llvm/llvm/toolchain/lib/clang/21/../../clc/remangled-l64-signed_char.libspirv-nvptx64-nvidia-cuda.bc -mlink-builtin-bitcode /usr/local/cuda-12.6/nvvm/libdevice/libdevice.10.bc -target-sdk-version=12.6 -target-cpu sm_50 -target-feature +ptx85 -debugger-tuning=gdb -fno-dwarf-directory-asm -fdebug-compilation-dir=/__w/llvm/llvm/build-e2e/DeviceLib -resource-dir /__w/llvm/llvm/toolchain/lib/clang/21 -Werror -Wno-unused-command-line-argument -ferror-limit 19 -fgpu-rdc -fno-builtin -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -o /tmp/lit-tmp-2wgf867m/cmath_test-sm_50-8a7f6e-753f80.s -x ir /tmp/lit-tmp-2wgf867m/cmath_test-sm_50-2f6ed4_1.bc
# | 1.	Code generation
# | 2.	Running pass 'Function Pass Manager' on module '/tmp/lit-tmp-2wgf867m/cmath_test-sm_50-2f6ed4_1.bc'.
# | 3.	Running pass 'NVPTX DAG->DAG Pattern Instruction Selection' on function '@_ZTSZZ19device_cmath_test_1IfEvRN4sycl3_V15queueEENKUlRNS1_7handlerEE_clES5_E15DeviceMathTest1'
# | Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
# | 0  clang-21  0x000000000272e8f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 40
# | 1  clang-21  0x000000000272c3be llvm::sys::RunSignalHandlers() + 238
# | 2  clang-21  0x000000000272ef81
# | 3  libc.so.6 0x000071b9a444b330
# | 4  libc.so.6 0x000071b9a44a4b2c pthread_kill + 284
# | 5  libc.so.6 0x000071b9a444b27e gsignal + 30
# | 6  libc.so.6 0x000071b9a442e8ff abort + 223
# | 7  clang-21  0x000000000269d31f
# | 8  clang-21  0x00000000037[395](https://github.com/intel/llvm/actions/runs/14208753799/job/39811918137#step:27:412)68
# | 9  clang-21  0x000000000372bbd4
# | 10 clang-21  0x000000000372ac18 llvm::SelectionDAG::Legalize() + 536
# | 11 clang-21  0x000000000381cc06 llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 4870
# | 12 clang-21  0x000000000381ac32 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 7106
# | 13 clang-21  0x0000000003817e40 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 592
# | 14 clang-21  0x0000000000ce7395
# | 15 clang-21  0x00000000038156c0 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) + 160
# | 16 clang-21  0x0000000001ba6453 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 1011
# | 17 clang-21  0x0000000002114465 llvm::FPPassManager::runOnFunction(llvm::Function&) + 629
# | 18 clang-21  0x000000000211c8a2 llvm::FPPassManager::runOnModule(llvm::Module&) + 50
# | 19 clang-21  0x0000000002114ed6 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1894
# | 20 clang-21  0x0000000002948851 clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) + 9953
# | 21 clang-21  0x0000000002f58cc5 clang::CodeGenAction::ExecuteAction() + 2933
# | 22 clang-21  0x0000000003216ad6 clang::FrontendAction::Execute() + 38
# | 23 clang-21  0x000000000318016d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1149
# | 24 clang-21  0x00000000032f11a9 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 473
# | 25 clang-21  0x0000000000c7ddbe cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 6302
# | 26 clang-21  0x0000000000c79def
# | 27 clang-21  0x0000000000c78ef8 clang_main(int, char**, llvm::ToolContext const&) + 4712
# | 28 clang-21  0x0000000000c88817 main + 87
# | 29 libc.so.6 0x000071b9a44301ca
# | 30 libc.so.6 0x000071b9a443028b __libc_start_main + 139
# | 31 clang-21  0x0000000000c77825 _start + 37
# | llvm-foreach: Aborted (core dumped)
# | clang++: error: clang frontend command failed with exit code 254 (use -v to see invocation)
# | clang version 21.0.0git (https://github.com/intel/llvm ebf7540f97726c973dc83fa42aae643d4a03b165)
# | Target: x86_64-unknown-linux-gnu
# | Thread model: posix
# | InstalledDir: /__w/llvm/llvm/toolchain/bin
# | Build config: +assertions
# | clang++: note: diagnostic msg: Error generating preprocessed source(s).
# `-----------------------------
# error: command failed with exit status: 1

--

Environment

  • OS: [e.g Windows/Linux]
  • Target device and vendor: [e.g. Nvidia GPU]
  • DPC++ version: [e.g. commit hash or output of clang++ --version]
  • Dependencies version: [e.g. the output of nvidia-smi and sycl-ls --verbose]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    SPIR-VIssues related to SPIRV-LLVM-TranslatorbugSomething isn't workingconfirmedpdtrackerPulldown tracker for issues/reverts that needs follow up

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions