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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to