<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54801>54801</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
run-time failure on amdgpu related to __omp_rtl_debug_kind
</td>
</tr>
<tr>
<th>Labels</th>
<td>
openmp,
backend:AMDGPU
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jdenny-ornl
</td>
</tr>
</table>
<pre>
At d0fcbb37838a (main from today) when offloading to an mi60 (amdgpu), I see the following failure:
```
$ cat test.c
int main() {
int arr1[2][2];
int arr2[2][2];
#pragma omp target
for (int i = 0; i < 2; ++i)
for (int j = 0; j < 2; ++j)
arr1[i][j] = arr2[i][j];
return 0;
}
$ clang -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa test.c
$ ./a.out
$ echo $?
134
```
Any of the following works around the problem:
- Compiling with -O1, -O2, or -O3.
- Reverting 2945f11c605b (D118399) and thus breaking `__omp_rtl_debug_kind` on nvptx.
- Adding a check for `CGM.getTriple().isAMDGCN()` in `CGOpenMPRuntimeGPU::CGOpenMPRuntimeGPU`, effectively reverting 2945f11c605b only for amdgpu.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1VEtvozAQ_jVwsUDGPEIOHNJErfbQbVXtniODDTgxNrJNuvn3O4awbaquBIw9L3_fzJhas2u1c4jhtqnrdFOmJUUBKQcqFGqNHpDTjF4DskXvPVdIt63UlAnVgQFRhQZRYB9AB9aNE_gFZI9-IMs5cj1HrZZSv3v3lgo5GR6kuwAfArx-C3x7li3JUEMdcty6uFl0Qjnk4cAhHkaweVj0CHkLNSYJ8gcS5IdVpF8dyH8dApKOhnYDRXoYkaOm4261tdp4Yj6HQEF6QBgC5-UeEb8MyAM8wnO-hdwFnT6CTl-DTndBaGUhFpAnEHPwDfsn9SfshrvJqPmAW_E2h09VlBSKHrV65AqorYto4Wghu-9YoyIQ_u0tvau6zxEH5JHGenIfKt70GjhkQfq4KJM0-76T83enrjAyXybhXZuzBW56Umw2jUbXkg__RiNCe2iHkLOzcD2KXhI_VtEL8QJKHL2k8er7xi_cOO-LyDbL2yRpCpzXvg2HJCnT7daPDZ3PmiyqDadn7w1Qj0c452icPDJeT90R9AzUSCukLqP78--MHZtHnqKm58156XKB90_PMRTzlxGj5Mt4xsLung9P-5_L1ieDizT7vkADnl_fJuXEwJ9ef3u66e4bPZQQWPK25Y0TFy6v0OqV4h1DrcDmsSyX74Y2ZFXKtumWhk44ySszqcinXm-gZ7cEQF5JHWf-Kn9XinAysuqdG63HSh7h6aAdUx03eoCNlJdVRNDDE-CFrbB24hYWeVbiJOwrVjRN2TD4sxRFnqRlXrcbXCR4m9R1tiFlKGnNpa1gxANCljmFhS8CiJo2Zw5tSXe-sFAe4u9wKCqCCcEZ3iTbvMyzuKF1s6GU4SLNcJ4lQYY5_DZk7OHF2nShqWakwM6CUQrr7IeRWis6xfmMAvLTyfXaVCfGlbpG2igZzsSqmdVf0UKIjA">