Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shiltian opened this issue Nov 8, 2024 · 2 comments · Fixed by #112251
Closed
Assignees
Labels
backend:AMDGPU mc Machine (object) code

Comments

@shiltian
Copy link
Contributor

shiltian commented Nov 8, 2024

; 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 -> ...

@shiltian shiltian self-assigned this Nov 8, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 8, 2024

@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 -> ...`.
</details>

@arsenm
Copy link
Contributor

arsenm commented Nov 8, 2024

Duplicate. This is fixed by #112251

@shiltian shiltian assigned JanekvO and unassigned shiltian Nov 8, 2024
@EugeneZelenko EugeneZelenko added the mc Machine (object) code label Nov 15, 2024
akshayrdeodhar pushed a commit to akshayrdeodhar/llvm-project that referenced this issue Nov 18, 2024
…tiple functions (llvm#112251)

I was wrong last patch. I viewed the `Visited` set purely as a possible
recursion deterrent where functions calling a callee multiple times are
handled elsewhere. This doesn't consider cases where a function is
called multiple times by different callers still part of the same call
graph. New test shows the aforementioned case.

Reapplies llvm#111004, fixes llvm#115562.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AMDGPU mc Machine (object) code
Projects
None yet
5 participants