<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Dependencies for undeferred tasks are blocking"
   href="https://bugs.llvm.org/show_bug.cgi?id=46193">46193</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Dependencies for undeferred tasks are blocking
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Clang Compiler Support
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>protze@itc.rwth-aachen.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23573" name="attach_23573" title="reproducer">attachment 23573</a> <a href="attachment.cgi?id=23573&action=edit" title="reproducer">[details]</a></span>
reproducer

Other than <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Dependencies for undeferred detached tasks are missing"
   href="show_bug.cgi?id=46185">https://bugs.llvm.org/show_bug.cgi?id=46185</a>, this is no correctness
issue, but a possible performance issue.

Clang transforms undeferred tasks semantically like this:

#pragma omp task depend(...) if(0)

to:

#pragma omp taskwait depend(...)
#pragma omp task if(0)

As stated in the previous issue, this is only valid for in/inout/out
dependencies in absense of a detached clause.
The dependency mutexinoutset would allow the undeferred task to execute unless
another task with the same dependency is currently running. In the attached
code, the second task is blocked by the dependency to the first task. The third
task executes right away. The forth task could execute, but waits for the
second task to finish.

>From my perspective, we should not use the _if0 runtime entry points in those
scenarios, but rather just mark the created task as undeferred and let the
runtime manage the execution.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>