-
Notifications
You must be signed in to change notification settings - Fork 12k
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] SI annotate control flow
pass failed with error failed to annotate CFG
#58861
Comments
@llvm/issue-subscribers-backend-amdgpu |
Codegen prepare invokes local transformations which eliminates the block with the return statement, the result conflicts with the invariants laid down in SIAnnotateControlFlow pass. |
Related patch: D136892 EDIT: Does not fix the issue. |
SIAnnotateControlFlow pass is able to annotate a simple non-nested infinite loop correctly. StructurizeCFG does not seem to perform any transformations on the following CFG after codegen-prepare pass: I tracked SIAnnotateControlFlow and observed that BB4 is the last node visited in the depth-first traversal of this graph. When BB4 is handled by |
@tstellar thoughts? |
If we ensure that no basic block is visited more than once, ie. pushed into the stack only if it was never pushed before, the code compiles. cc @arsenm |
That make sense to me. |
Differential Revision: https://reviews.llvm.org/D139780 |
This patch allows AMDGPUUnifyDivergenceExitNodes pass to transform a function whose PDT has exactly one root and ends in a branch instruction. Fixes llvm/llvm-project#58861. Reviewed By: ruiling, arsenm Differential Revision: https://reviews.llvm.org/D139780
Description
The following IR code containing an infinite loop (which should compile) cause
SI annotate control flow
pass to fail with errorfailed to annotate CFG
when targetingamdgcn
.The problem does not exist when targeting
x86_64
,aarch64
,wasm64
, orriscv64
.Minimal Reproduction
https://godbolt.org/z/snsTaonnr
Code
Stack Trace
The text was updated successfully, but these errors were encountered: