Issue 170048
Summary [AMDGPU][Uniformity Analysis] Assertion `Cycle->getHeader() == JoinBlock' failed.
Labels backend:AMDGPU, crash
Assignees
Reporter XChy
    Reproducer: https://godbolt.org/z/h6fcqGv4c
Reduced 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 i16 @func_38(i1 %tobool5.not) {
entry:
  br i1 false, label %entry.for.end11_crit_edge, label %for.cond1

entry.for.end11_crit_edge:                        ; preds = %entry
  br label %for.end11

for.cond1: ; preds = %for.end11, %for.cond4, %entry
  br label %BS_LABEL_6

BS_LABEL_6:                                       ; preds = %for.body6, %for.cond1
  br label %for.cond4

for.cond4: ; preds = %for.body6, %BS_LABEL_6
  br i1 %tobool5.not, label %for.cond1, label %for.body6

for.body6: ; preds = %for.cond4
  callbr void asm sideeffect "", "!i,!i"()
          to label %for.cond4 [label %BS_LABEL_6, label %for.end11]

for.end11:                                        ; preds = %if.end14.for.end11_crit_edge, %for.body6, %entry.for.end11_crit_edge
  br i1 false, label %if.end14, label %for.cond1

if.end14: ; preds = %for.end11
  br i1 false, label %if.end14.for.end11_crit_edge, label %sw.epilog

if.end14.for.end11_crit_edge:                     ; preds = %if.end14
  br label %for.end11

sw.epilog: ; preds = %if.end14
  ret i16 0
}
```

Dump:
```
llc: /root/llvm-project/llvm/include/llvm/ADT/GenericUniformityImpl.h:966: const CycleT* llvm::getExtDivCycle(const CycleT*, const BlockT*, const BlockT*) [with CycleT = llvm::GenericCycle<llvm::GenericSSAContext<llvm::Function> >; BlockT = llvm::BasicBlock]: Assertion `Cycle->getHeader() == JoinBlock' 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 -O0 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'Uniformity Analysis' on function '@func_38'
 #0 0x00000000041df148 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x41df148)
 #1 0x00000000041dbff4 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #2 0x0000706081a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x0000706081a969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x0000706081a42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x0000706081a287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x0000706081a2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x0000706081a39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x0000000002d099fa llvm::GenericUniformityAnalysisImpl<llvm::GenericSSAContext<llvm::Function>>::analyzeControlDivergence(llvm::Instruction const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2d099fa)
 #9 0x0000000002d09c3b llvm::GenericUniformityAnalysisImpl<llvm::GenericSSAContext<llvm::Function>>::compute() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2d09c3b)
#10 0x0000000002d0a282 llvm::UniformityInfoWrapperPass::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2d0a282)
#11 0x000000000371a9e6 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x371a9e6)
#12 0x000000000371ad91 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x371ad91)
#13 0x000000000371b5ff llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x371b5ff)
#14 0x00000000008f909f compileModule(char**, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#15 0x00000000007c6299 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c6299)
#16 0x0000706081a29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#17 0x0000706081a29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#18 0x00000000008ee345 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8ee345)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to