Open Dinistro opened 6 months ago
Pinging @alexey-bataev and @jdoerfert, as they were involved in the revision that originally introduced this feature: https://reviews.llvm.org/D79948#change-6nyECRH02yni
Looks like there is a compiler crash during codegen
Looks like there is a compiler crash during codegen
This is the case for clang17, but it passes for me with clang18.
NVM, my local build also explodes now. I wonder what the difference to the compiler explorer version is.
@llvm/issue-subscribers-clang-codegen
Author: Christian Ulmann (Dinistro)
IMO, the problem is in generation of declarations for OMP scan temporary variables. The temporary buffer declaration is tied to worksharing for
region and it should be tied to omp parallel
region. This makes the buffer thread private and it should be shared. I've tried to move those decls out of the parallel region, but wasn't successful, as OMP Codegen for scan temporary vars is tied to worksharing region
. More details on discourse.
@alexey-bataev do you have any idea, how hard is to fix this?
Thanks!
We stumbled over an issue in the code gen for
omp scan
. For a simple example like the following, the "inscan variable" is not properly initialized.For a properly initialized
thread_data
,scan
is filled up with random data. The generated IR shows that there are a few basic blocks in the outlined function that are unreachable, which seems suspicious.Full example with code, IR, and a CFG visualization: https://godbolt.org/z/rna6K8T6Y