[llvm] 0891ccc - [Frontend][OpenMP] Apply ompx_attribute to all allowing leaf constructs (#100370)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 11:22:32 PDT 2024


Author: Krzysztof Parzyszek
Date: 2024-07-24T13:22:28-05:00
New Revision: 0891ccc0c68c35e17562c752955788f08054bcdb

URL: https://github.com/llvm/llvm-project/commit/0891ccc0c68c35e17562c752955788f08054bcdb
DIFF: https://github.com/llvm/llvm-project/commit/0891ccc0c68c35e17562c752955788f08054bcdb.diff

LOG: [Frontend][OpenMP] Apply ompx_attribute to all allowing leaf constructs (#100370)

By default, in a compound directive, a clause will apply to the unique
leaf construct that allows it. Clauses that could apply to multiple leaf
constructs follow different rules.

For ompx_attribute, apply it to all leaf constructs that allow it.

Added: 
    

Modified: 
    llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h b/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
index 3feb4bd11c998..349d862135d8c 100644
--- a/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
+++ b/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
@@ -236,6 +236,9 @@ struct ConstructDecompositionT {
                    const ClauseTy *);
   bool applyClause(const tomp::clause::NowaitT<TypeTy, IdTy, ExprTy> &clause,
                    const ClauseTy *);
+  bool
+  applyClause(const tomp::clause::OmpxAttributeT<TypeTy, IdTy, ExprTy> &clause,
+              const ClauseTy *);
 
   uint32_t version;
   llvm::omp::Directive construct;
@@ -1101,6 +1104,13 @@ bool ConstructDecompositionT<C, H>::applyClause(
   return applyToOutermost(node);
 }
 
+template <typename C, typename H>
+bool ConstructDecompositionT<C, H>::applyClause(
+    const tomp::clause::OmpxAttributeT<TypeTy, IdTy, ExprTy> &clause,
+    const ClauseTy *node) {
+  return applyToAll(node);
+}
+
 template <typename C, typename H> bool ConstructDecompositionT<C, H>::split() {
   bool success = true;
 


        


More information about the llvm-commits mailing list