[PATCH] D157197: [clang][CodeGen][OpenMP] Fix if-clause for 'target teams loop'

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 8 06:52:23 PDT 2023


ABataev added inline comments.


================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:1570-1575
+  // If we are here with a 'target teams loop' then we are emitting the
+  // 'parallel' region of the 'target teams distribute parallel for'
+  // emitted in place of the 'target teams loop'. Based on the specification
+  // noted above, an if-clause associated with a 'target teams loop', be it
+  // 'if(val)' or an 'if(target:val)', will apply only to 'target' and not
+  // the 'parallel' of the 'target teams distribute parallel for'.
----------------
It does not match the spec. 
```
For a combined or composite construct, if no directive-name-modifier is specified then the if clause applies to all constituent constructs to which an if clause can apply.
```
So, if(val) should be applied to both target and parallel regions, no?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157197/new/

https://reviews.llvm.org/D157197



More information about the cfe-commits mailing list