Skip to content

[NVPTX] llc: LLVM ERROR: Cannot select: 0x6019bc223ca0: i64,ch = stacksave 0x6019bc1dbbd0 #100641

@jaredhoberock

Description

@jaredhoberock

When run on the attached .ll file, llc crashes with an LLVM ERROR:

❯ llc-18 -march=nvptx64 repro.ll
LLVM ERROR: Cannot select: 0x6019bc223ca0: i64,ch = stacksave 0x6019bc1dbbd0
In function: _Z6kernelv
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: llc-18 -march=nvptx64 repro.ll
1.	Running pass 'Function Pass Manager' on module 'repro.ll'.
2.	Running pass 'NVPTX DAG->DAG Pattern Instruction Selection' on function '@_Z6kernelv'
 #0 0x000077e4163a63bf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:723:13
 #1 0x000077e4163a44f9 llvm::sys::RunSignalHandlers() build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Signals.cpp:106:18
 #2 0x000077e4163a6b00 SignalHandler build-llvm/tools/clang/stage2-bins/llvm/lib/Support/Unix/Signals.inc:413:1
 #3 0x000077e414e45320 (/lib/x86_64-linux-gnu/libc.so.6+0x45320)
 #4 0x000077e414e9eb1c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x000077e414e9eb1c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x000077e414e9eb1c pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x000077e414e4526e raise ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x000077e414e288ff abort ./stdlib/abort.c:81:7
 #9 0x000077e4162fe0c2 llvm::report_fatal_error(llvm::Twine const&, bool) build-llvm/tools/clang/stage2-bins/llvm/lib/Support/ErrorHandling.cpp:125:5
#10 0x000077e416c2f8e3 (/usr/lib/llvm-18/bin/../lib/libLLVM.so.18.1+0x162f8e3)
#11 0x000077e416c2ed76 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) build-llvm/tools/clang/stage2-bins/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:0:0
#12 0x000077e416c2611f llvm::SelectionDAGISel::DoInstructionSelection() build-llvm/tools/clang/stage2-bins/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1146:28
#13 0x000077e416c25790 ~TimeRegion build-llvm/tools/clang/stage2-bins/llvm/include/llvm/Support/Timer.h:155:9
#14 0x000077e416c25790 llvm::SelectionDAGISel::CodeGenAndEmitDAG() build-llvm/tools/clang/stage2-bins/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:987:3
#15 0x000077e416c248de llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) build-llvm/tools/clang/stage2-bins/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1511:8
#16 0x000077e416c22934 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) build-llvm/tools/clang/stage2-bins/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:0:3
#17 0x000077e4167826b9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) build-llvm/tools/clang/stage2-bins/llvm/lib/CodeGen/MachineFunctionPass.cpp:0:13
#18 0x000077e4164f7772 llvm::FPPassManager::runOnFunction(llvm::Function&) build-llvm/tools/clang/stage2-bins/llvm/lib/IR/LegacyPassManager.cpp:1443:27
#19 0x000077e4164fd2f4 llvm::FPPassManager::runOnModule(llvm::Module&) build-llvm/tools/clang/stage2-bins/llvm/lib/IR/LegacyPassManager.cpp:1489:13
#20 0x000077e4164f7e9f runOnModule build-llvm/tools/clang/stage2-bins/llvm/lib/IR/LegacyPassManager.cpp:0:27
#21 0x000077e4164f7e9f llvm::legacy::PassManagerImpl::run(llvm::Module&) build-llvm/tools/clang/stage2-bins/llvm/lib/IR/LegacyPassManager.cpp:541:44
#22 0x00006019ba65227f compileModule build-llvm/tools/clang/stage2-bins/llvm/tools/llc/llc.cpp:745:17
#23 0x00006019ba65227f main build-llvm/tools/clang/stage2-bins/llvm/tools/llc/llc.cpp:412:22
#24 0x000077e414e2a1ca __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#25 0x000077e414e2a28b call_init ./csu/../csu/libc-start.c:128:20
#26 0x000077e414e2a28b __libc_start_main ./csu/../csu/libc-start.c:347:5
#27 0x00006019ba64cd95 _start (/usr/lib/llvm-18/bin/llc+0x10d95)
Aborted (core dumped)

llc details:

❯ llc-18 --version
Ubuntu LLVM version 18.1.3
  Optimized build.
  Default target: x86_64-pc-linux-gnu
  Host CPU: alderlake

  Registered Targets:
    aarch64     - AArch64 (little endian)
    aarch64_32  - AArch64 (little endian ILP32)
    aarch64_be  - AArch64 (big endian)
    amdgcn      - AMD GCN GPUs
    arm         - ARM
    arm64       - ARM64 (little endian)
    arm64_32    - ARM64 (little endian ILP32)
    armeb       - ARM (big endian)
    avr         - Atmel AVR Microcontroller
    bpf         - BPF (host endian)
    bpfeb       - BPF (big endian)
    bpfel       - BPF (little endian)
    hexagon     - Hexagon
    lanai       - Lanai
    loongarch32 - 32-bit LoongArch
    loongarch64 - 64-bit LoongArch
    m68k        - Motorola 68000 family
    mips        - MIPS (32-bit big endian)
    mips64      - MIPS (64-bit big endian)
    mips64el    - MIPS (64-bit little endian)
    mipsel      - MIPS (32-bit little endian)
    msp430      - MSP430 [experimental]
    nvptx       - NVIDIA PTX 32-bit
    nvptx64     - NVIDIA PTX 64-bit
    ppc32       - PowerPC 32
    ppc32le     - PowerPC 32 LE
    ppc64       - PowerPC 64
    ppc64le     - PowerPC 64 LE
    r600        - AMD GPUs HD2XXX-HD6XXX
    riscv32     - 32-bit RISC-V
    riscv64     - 64-bit RISC-V
    sparc       - Sparc
    sparcel     - Sparc LE
    sparcv9     - Sparc V9
    systemz     - SystemZ
    thumb       - Thumb
    thumbeb     - Thumb (big endian)
    ve          - VE
    wasm32      - WebAssembly 32-bit
    wasm64      - WebAssembly 64-bit
    x86         - 32-bit X86: Pentium-Pro and above
    x86-64      - 64-bit X86: EM64T and AMD64
    xcore       - XCore
    xtensa      - Xtensa 32

repro.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions