llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.01k stars 11.95k forks source link

[AMDGPU] Compiler crash in `AMDGPUAsmPrinter` with circular function call involvement #115562

Open shiltian opened 1 day ago

shiltian commented 1 day ago
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 small.ll %s -o -

define amdgpu_kernel void @kernel() {
entry:
  call void @callee1()
  ret void
}

define void @callee1() #0 {
entry:
  call void @callee2()
  ret void
}

define void @callee2() #0 {
entry:
  call void @callee1()
  ret void
}

attributes #0 = { noinline }

The crash is because of stack overflow.

evaluateAsRelocatable -> evaluateAsRelocatableImpl -> evaluateAsRelocatableImpl -> evaluateAsRelocatable -> ...

llvmbot commented 1 day ago

@llvm/issue-subscribers-backend-amdgpu

Author: Shilei Tian (shiltian)

``` ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 small.ll %s -o - define amdgpu_kernel void @kernel() { entry: call void @callee1() ret void } define void @callee1() #0 { entry: call void @callee2() ret void } define void @callee2() #0 { entry: call void @callee1() ret void } attributes #0 = { noinline } ``` The crash is because of stack overflow. `evaluateAsRelocatable -> evaluateAsRelocatableImpl -> evaluateAsRelocatableImpl -> evaluateAsRelocatable -> ...`.
arsenm commented 1 day ago

Duplicate. This is fixed by #112251