| Issue |
173785
|
| Summary |
[AMDGPU] Assertion `calculateDivergence(N) == N->isDivergent() && "Divergence bit inconsistency detected"' failed.
|
| Labels |
backend:AMDGPU,
crash-on-valid
|
| Assignees |
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/694qYYbWo
Testcase:
```llvm
target datalayout = "e-m:e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9"
target triple = "amdgcn-amd-amdhsa"
define void @func_1() #0 {
entry:
%0 = load ptr addrspace(5), ptr addrspace(5) null, align 8
store i64 0, ptr addrspace(5) %0, align 8
%l_1303.sroa.5.0..sroa_idx.i.i = getelementptr i8, ptr addrspace(5) %0, i32 8
store i64 0, ptr addrspace(5) %l_1303.sroa.5.0..sroa_idx.i.i, align 8
call void @llvm.memcpy.p5.p5.i64(ptr addrspace(5) null, ptr addrspace(5) align 8 %0, i64 16, i1 false)
ret void
}
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p5.p5.i64(ptr addrspace(5) noalias writeonly captures(none), ptr addrspace(5) noalias readonly captures(none), i64, i1 immarg) #1
attributes #0 = { "target-cpu"="gfx1201" }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
```
Dump:
```
llc: /root/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:12562: void llvm::SelectionDAG::VerifyDAGDivergence(): Assertion `calculateDivergence(N) == N->isDivergent() && "Divergence bit inconsistency detected"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
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 'CallGraph Pass Manager' on module '<source>'.
2. Running pass 'AMDGPU DAG->DAG Pattern Instruction Selection' on function '@func_1'
#0 0x0000000004243a68 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4243a68)
#1 0x0000000004240914 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x00007818d8e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x00007818d8e969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x00007818d8e42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x00007818d8e287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x00007818d8e2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x00007818d8e39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x0000000003f533dd (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3f533dd)
#9 0x0000000003fd8ef9 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fd8ef9)
#10 0x0000000003fdbce8 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fdbce8)
#11 0x0000000003fdd81c llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fdd81c)
#12 0x000000000123eaf5 llvm::AMDGPUDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x123eaf5)
#13 0x0000000003fc90af llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fc90af)
#14 0x000000000311b0b9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#15 0x000000000376de06 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x376de06)
#16 0x0000000002b681d8 (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) CallGraphSCCPass.cpp:0:0
#17 0x000000000376ea1f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x376ea1f)
#18 0x00000000009025fd compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#19 0x00000000007cbcdc main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7cbcdc)
#20 0x00007818d8e29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#21 0x00007818d8e29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#22 0x00000000008f72d5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8f72d5)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs