Skip to content

Crash during nvptx codegen/instruction selection #117606

Closed
@wsmoses

Description

@wsmoses

https://godbolt.org/z/fGWzdfvM1

LLVM ERROR: PTX does not support "atomic" for orderings different than"NotAtomic" or "Monotonic" for sm_60 or older, but order is: "seq_cst".
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'NVPTX DAG->DAG Pattern Instruction Selection' on function '@diffe_ZL9atomicAddPdd'
 #0 0x0000000003c15cd8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3c15cd8)
 #1 0x0000000003c136cc SignalHandler(int) Signals.cpp:0:0
 #2 0x00007cc624442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007cc6244969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007cc624442476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007cc6244287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x0000000000758499 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x758499)
 #7 0x000000000196156b llvm::NVPTXDAGToDAGISel::insertMemoryInstructionFence(llvm::SDLoc, llvm::SDValue&, llvm::MemSDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x196156b)
 #8 0x00000000019631c5 llvm::NVPTXDAGToDAGISel::tryLoad(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x19631c5)
 #9 0x00000000019670e3 llvm::NVPTXDAGToDAGISel::Select(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x19670e3)
#10 0x00000000039bc70b llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x39bc70b)
#11 0x00000000039cba3a llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x39cba3a)
#12 0x00000000039cf022 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x39cf022)
#13 0x00000000039d0340 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x39d0340)
#14 0x00000000019681c3 llvm::NVPTXDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x19681c3)
#15 0x00000000039c0c0f llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x39c0c0f)
#16 0x0000000002b7a219 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#17 0x0000000003180250 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3180250)
#18 0x0000000003180601 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3180601)
#19 0x0000000003180eb7 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3180eb7)
#20 0x000000000086bed8 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#21 0x000000000075fbbe main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x75fbbe)
#22 0x00007cc624429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#23 0x00007cc624429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#24 0x000000000086281e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x86281e)

However the function in question is marked sm_80:


; Function Attrs: mustprogress nofree noinline norecurse nounwind willreturn
define internal fastcc double @diffe_ZL9atomicAddPdd(ptr nocapture noundef %address, ptr nocapture readonly %"address'", double noundef %val) unnamed_addr #143 {
entry:
  %0 = atomicrmw fadd ptr %address, double %val seq_cst, align 8
  %1 = load atomic double, ptr %"address'" seq_cst, align 8
  ret double %1
}

attributes #143 = { mustprogress nofree noinline norecurse nounwind willreturn "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_80" "target-features"="+ptx75,+sm_80" }

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