<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63560>63560</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[OpenMP] Offload should assume non-zero trip count for associated loops
</td>
</tr>
<tr>
<th>Labels</th>
<td>
openmp
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jdoerfert
</td>
</tr>
</table>
<pre>
If we offload and have associated loops we pass the trip count to the runtime call to launch the kernel.
If the trip count is 0 we should not launch the kernel at all.
We should also add an assumption into the kernel that the trip count is at least one.
The `icmp` in line 34 is the one we can consequently remove:
https://godbolt.org/z/rYhczcd1j
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxskk9vnDwQxj-NuYyyMubPsgcO76sIKYcqPVSqejT2sDg1HmoPqbKfvjIlbZT0AsLM85tnPI9OyV0DYi-a_0VzX-iNZ4r9kyWME0YuRrIv_cMEPxFomjxpCzpYmPUzgk6JjNOMFjzRmnLRqlMCnhE4uhUMbYGBaT-JW2C3IBjtfT7zegtm3n99xxjQn4S8F_K_h-k9wCWQGZ5m2ryFQPxRDJpB-1fG1z_F2icCbbPtbHhbVnYUwIXD1aHmWfM_2moGjzoxUMAD_fv5ZUYQrXRmWUUrwQXwLiBUdVZlDgXMlo0OYCgk_LFhYP8CERd6RlEdnJl5TflLDUINV7IjeT5RvAo13IQa4rfZ3Iwtn942L2xf2Ut10QX2Zdudu-5yrsti7sdWldOlMeVlrMy5aydzxq6yppa6wwbrwvVKqkq26lx2ZVOXp3bs2qmS2pRoUZlS1BIX7fzJ--cl-yhcShv2bdW0svB6RJ_2sChFK4ZlFUrl4MQ-C-7G7ZpELb1LnP4i2LHfI_a4Yvj0WTT38HiE6XVLeTMIgcLdDSO93cJE8UPSii36_t3VOZ638WRoEWrInY_X3RrpCQ0LNeyTJKGGfZhfAQAA___SZP23">