[llvm-bugs] [Bug 49777] New: Clang should not try to specialize orphaned directives in device codegen

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 30 14:07:17 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=49777

            Bug ID: 49777
           Summary: Clang should not try to specialize orphaned directives
                    in device codegen
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jdoerfert at anl.gov
                CC: a.bataev at hotmail.com, llvm-bugs at lists.llvm.org

For this code (https://godbolt.org/z/TnErqhTzK)
```
void work();

void use() {
  #pragma omp parallel
  work();
}

int main() {
  #pragma omp target parallel
  {  use(); }
  #pragma omp target
  {  use(); }
}
```
clang will serialize the parallel region in `use`.
This is not technically wrong but arguably not the right thing to do.
Even if we would not have the second target region, the `use` function
can be reached from the outside and specialization should not occur
for it at all. In general, I don't believe we should specialize early.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210330/74a10955/attachment.html>


More information about the llvm-bugs mailing list