A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/llvm/llvm-project/commit/bb83f8e70bd1d56152f02307adacd718cd67e312 below:

[OpenMP] Initial parsing and sema for 'parallel masked' construct · llvm/llvm-project@bb83f8e · GitHub

File tree Expand file treeCollapse file tree 35 files changed

+2474

-4

lines changed

Filter options

Expand file treeCollapse file tree 35 files changed

+2474

-4

lines changed Original file line number Diff line number Diff line change

@@ -1312,7 +1312,7 @@ def __repr__(self):

1312 1312

#

1313 1313

# The translation unit cursor exists primarily to act as the root cursor for

1314 1314

# traversing the contents of a translation unit.

1315 -

CursorKind.TRANSLATION_UNIT = CursorKind(300)

1315 +

CursorKind.TRANSLATION_UNIT = CursorKind(350)

1316 1316 1317 1317

###

1318 1318

# Attributes

Original file line number Diff line number Diff line change

@@ -2626,15 +2626,19 @@ enum CXCursorKind {

2626 2626

*/

2627 2627

CXCursor_OMPTargetParallelGenericLoopDirective = 299,

2628 2628 2629 -

CXCursor_LastStmt = CXCursor_OMPTargetParallelGenericLoopDirective,

2629 +

/** OpenMP parallel masked directive.

2630 +

*/

2631 +

CXCursor_OMPParallelMaskedDirective = 300,

2632 + 2633 +

CXCursor_LastStmt = CXCursor_OMPParallelMaskedDirective,

2630 2634 2631 2635

/**

2632 2636

* Cursor that represents the translation unit itself.

2633 2637

*

2634 2638

* The translation unit cursor exists primarily to act as the root

2635 2639

* cursor for traversing the contents of a translation unit.

2636 2640

*/

2637 -

CXCursor_TranslationUnit = 300,

2641 +

CXCursor_TranslationUnit = 350,

2638 2642 2639 2643

/* Attributes */

2640 2644

CXCursor_FirstAttr = 400,

Original file line number Diff line number Diff line change

@@ -2994,6 +2994,9 @@ DEF_TRAVERSE_STMT(OMPParallelForSimdDirective,

2994 2994

DEF_TRAVERSE_STMT(OMPParallelMasterDirective,

2995 2995

{ TRY_TO(TraverseOMPExecutableDirective(S)); })

2996 2996 2997 +

DEF_TRAVERSE_STMT(OMPParallelMaskedDirective,

2998 +

{ TRY_TO(TraverseOMPExecutableDirective(S)); })

2999 + 2997 3000

DEF_TRAVERSE_STMT(OMPParallelSectionsDirective,

2998 3001

{ TRY_TO(TraverseOMPExecutableDirective(S)); })

2999 3002 Original file line number Diff line number Diff line change

@@ -2304,6 +2304,69 @@ class OMPParallelMasterDirective : public OMPExecutableDirective {

2304 2304

}

2305 2305

};

2306 2306 2307 +

/// This represents '#pragma omp parallel masked' directive.

2308 +

///

2309 +

/// \code

2310 +

/// #pragma omp parallel masked filter(tid)

2311 +

/// \endcode

2312 +

/// In this example directive '#pragma omp parallel masked' has a clause

2313 +

/// 'filter' with the variable tid

2314 +

///

2315 +

class OMPParallelMaskedDirective final : public OMPExecutableDirective {

2316 +

friend class ASTStmtReader;

2317 +

friend class OMPExecutableDirective;

2318 + 2319 +

OMPParallelMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc)

2320 +

: OMPExecutableDirective(OMPParallelMaskedDirectiveClass,

2321 +

llvm::omp::OMPD_parallel_masked, StartLoc,

2322 +

EndLoc) {}

2323 + 2324 +

explicit OMPParallelMaskedDirective()

2325 +

: OMPExecutableDirective(OMPParallelMaskedDirectiveClass,

2326 +

llvm::omp::OMPD_parallel_masked,

2327 +

SourceLocation(), SourceLocation()) {}

2328 + 2329 +

/// Sets special task reduction descriptor.

2330 +

void setTaskReductionRefExpr(Expr *E) { Data->getChildren()[0] = E; }

2331 + 2332 +

public:

2333 +

/// Creates directive with a list of \a Clauses.

2334 +

///

2335 +

/// \param C AST context.

2336 +

/// \param StartLoc Starting location of the directive kind.

2337 +

/// \param EndLoc Ending Location of the directive.

2338 +

/// \param Clauses List of clauses.

2339 +

/// \param AssociatedStmt Statement, associated with the directive.

2340 +

/// \param TaskRedRef Task reduction special reference expression to handle

2341 +

/// taskgroup descriptor.

2342 +

///

2343 +

static OMPParallelMaskedDirective *

2344 +

Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,

2345 +

ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef);

2346 + 2347 +

/// Creates an empty directive with the place for \a NumClauses

2348 +

/// clauses.

2349 +

///

2350 +

/// \param C AST context.

2351 +

/// \param NumClauses Number of clauses.

2352 +

///

2353 +

static OMPParallelMaskedDirective *

2354 +

CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell);

2355 + 2356 +

/// Returns special task reduction reference expression.

2357 +

Expr *getTaskReductionRefExpr() {

2358 +

return cast_or_null<Expr>(Data->getChildren()[0]);

2359 +

}

2360 +

const Expr *getTaskReductionRefExpr() const {

2361 +

return const_cast<OMPParallelMaskedDirective *>(this)

2362 +

->getTaskReductionRefExpr();

2363 +

}

2364 + 2365 +

static bool classof(const Stmt *T) {

2366 +

return T->getStmtClass() == OMPParallelMaskedDirectiveClass;

2367 +

}

2368 +

};

2369 + 2307 2370

/// This represents '#pragma omp parallel sections' directive.

2308 2371

///

2309 2372

/// \code

Original file line number Diff line number Diff line change

@@ -282,6 +282,7 @@ def OMPTargetTeamsDistributeSimdDirective : StmtNode<OMPLoopDirective>;

282 282

def OMPInteropDirective : StmtNode<OMPExecutableDirective>;

283 283

def OMPDispatchDirective : StmtNode<OMPExecutableDirective>;

284 284

def OMPMaskedDirective : StmtNode<OMPExecutableDirective>;

285 +

def OMPParallelMaskedDirective : StmtNode<OMPExecutableDirective>;

285 286

def OMPGenericLoopDirective : StmtNode<OMPLoopDirective>;

286 287

def OMPTeamsGenericLoopDirective : StmtNode<OMPLoopDirective>;

287 288

def OMPTargetTeamsGenericLoopDirective : StmtNode<OMPLoopDirective>;

Original file line number Diff line number Diff line change

@@ -10942,6 +10942,12 @@ class Sema final {

10942 10942

Stmt *AStmt,

10943 10943

SourceLocation StartLoc,

10944 10944

SourceLocation EndLoc);

10945 +

/// Called on well-formed '\#pragma omp parallel masked' after

10946 +

/// parsing of the associated statement.

10947 +

StmtResult ActOnOpenMPParallelMaskedDirective(ArrayRef<OMPClause *> Clauses,

10948 +

Stmt *AStmt,

10949 +

SourceLocation StartLoc,

10950 +

SourceLocation EndLoc);

10945 10951

/// Called on well-formed '\#pragma omp parallel sections' after

10946 10952

/// parsing of the associated statement.

10947 10953

StmtResult ActOnOpenMPParallelSectionsDirective(ArrayRef<OMPClause *> Clauses,

Original file line number Diff line number Diff line change

@@ -1922,6 +1922,7 @@ enum StmtCode {

1922 1922

STMT_OMP_PARALLEL_FOR_DIRECTIVE,

1923 1923

STMT_OMP_PARALLEL_FOR_SIMD_DIRECTIVE,

1924 1924

STMT_OMP_PARALLEL_MASTER_DIRECTIVE,

1925 +

STMT_OMP_PARALLEL_MASKED_DIRECTIVE,

1925 1926

STMT_OMP_PARALLEL_SECTIONS_DIRECTIVE,

1926 1927

STMT_OMP_TASK_DIRECTIVE,

1927 1928

STMT_OMP_TASKYIELD_DIRECTIVE,

Original file line number Diff line number Diff line change

@@ -682,6 +682,22 @@ OMPParallelMasterDirective::CreateEmpty(const ASTContext &C,

682 682

C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);

683 683

}

684 684 685 +

OMPParallelMaskedDirective *OMPParallelMaskedDirective::Create(

686 +

const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,

687 +

ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef) {

688 +

auto *Dir = createDirective<OMPParallelMaskedDirective>(

689 +

C, Clauses, AssociatedStmt, /*NumChildren=*/1, StartLoc, EndLoc);

690 +

Dir->setTaskReductionRefExpr(TaskRedRef);

691 +

return Dir;

692 +

}

693 + 694 +

OMPParallelMaskedDirective *

695 +

OMPParallelMaskedDirective::CreateEmpty(const ASTContext &C,

696 +

unsigned NumClauses, EmptyShell) {

697 +

return createEmptyDirective<OMPParallelMaskedDirective>(

698 +

C, NumClauses, /*HasAssociatedStmt=*/true, /*NumChildren=*/1);

699 +

}

700 + 685 701

OMPParallelSectionsDirective *OMPParallelSectionsDirective::Create(

686 702

const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,

687 703

ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef,

Original file line number Diff line number Diff line change

@@ -749,6 +749,12 @@ void StmtPrinter::VisitOMPParallelMasterDirective(

749 749

PrintOMPExecutableDirective(Node);

750 750

}

751 751 752 +

void StmtPrinter::VisitOMPParallelMaskedDirective(

753 +

OMPParallelMaskedDirective *Node) {

754 +

Indent() << "#pragma omp parallel masked";

755 +

PrintOMPExecutableDirective(Node);

756 +

}

757 + 752 758

void StmtPrinter::VisitOMPParallelSectionsDirective(

753 759

OMPParallelSectionsDirective *Node) {

754 760

Indent() << "#pragma omp parallel sections";

Original file line number Diff line number Diff line change

@@ -988,6 +988,11 @@ void StmtProfiler::VisitOMPParallelMasterDirective(

988 988

VisitOMPExecutableDirective(S);

989 989

}

990 990 991 +

void StmtProfiler::VisitOMPParallelMaskedDirective(

992 +

const OMPParallelMaskedDirective *S) {

993 +

VisitOMPExecutableDirective(S);

994 +

}

995 + 991 996

void StmtProfiler::VisitOMPParallelSectionsDirective(

992 997

const OMPParallelSectionsDirective *S) {

993 998

VisitOMPExecutableDirective(S);

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4