Skip to content

Commit 1dd68fe

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:d325c5d00b14 into amd-gfx:ff50e60be1c7
Local branch amd-gfx ff50e60 Merged main:d5cad0550626 into amd-gfx:1b9a5a807978 Remote branch main d325c5d [flang] Extension: unrestricted intrinsics as specifics in generics
2 parents ff50e60 + d325c5d commit 1dd68fe

File tree

67 files changed

+1299
-1385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1299
-1385
lines changed

clang/include/clang/AST/StmtOpenMP.h

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,6 @@ class OMPExecutableDirective : public Stmt {
281281
return Data->getClauses();
282282
}
283283

284-
/// Was this directive mapped from an another directive?
285-
/// e.g. 1) omp loop bind(parallel) is mapped to OMPD_for
286-
/// 2) omp loop bind(teams) is mapped to OMPD_distribute
287-
/// 3) omp loop bind(thread) is mapped to OMPD_simd
288-
/// It was necessary to note it down in the Directive because of
289-
/// clang::TreeTransform::TransformOMPExecutableDirective() pass in
290-
/// the frontend.
291-
OpenMPDirectiveKind PrevMappedDirective = llvm::omp::OMPD_unknown;
292-
293284
protected:
294285
/// Data, associated with the directive.
295286
OMPChildren *Data = nullptr;
@@ -354,10 +345,6 @@ class OMPExecutableDirective : public Stmt {
354345
return Inst;
355346
}
356347

357-
void setMappedDirective(OpenMPDirectiveKind MappedDirective) {
358-
PrevMappedDirective = MappedDirective;
359-
}
360-
361348
public:
362349
/// Iterates over expressions/statements used in the construct.
363350
class used_clauses_child_iterator
@@ -611,8 +598,6 @@ class OMPExecutableDirective : public Stmt {
611598
"Expected directive with the associated statement.");
612599
return Data->getRawStmt();
613600
}
614-
615-
OpenMPDirectiveKind getMappedDirective() const { return PrevMappedDirective; }
616601
};
617602

618603
/// This represents '#pragma omp parallel' directive.
@@ -1619,8 +1604,7 @@ class OMPSimdDirective : public OMPLoopDirective {
16191604
SourceLocation EndLoc, unsigned CollapsedNum,
16201605
ArrayRef<OMPClause *> Clauses,
16211606
Stmt *AssociatedStmt,
1622-
const HelperExprs &Exprs,
1623-
OpenMPDirectiveKind ParamPrevMappedDirective);
1607+
const HelperExprs &Exprs);
16241608

16251609
/// Creates an empty directive with the place
16261610
/// for \a NumClauses clauses.
@@ -1698,8 +1682,7 @@ class OMPForDirective : public OMPLoopDirective {
16981682
SourceLocation EndLoc, unsigned CollapsedNum,
16991683
ArrayRef<OMPClause *> Clauses,
17001684
Stmt *AssociatedStmt, const HelperExprs &Exprs,
1701-
Expr *TaskRedRef, bool HasCancel,
1702-
OpenMPDirectiveKind ParamPrevMappedDirective);
1685+
Expr *TaskRedRef, bool HasCancel);
17031686

17041687
/// Creates an empty directive with the place
17051688
/// for \a NumClauses clauses.
@@ -4423,8 +4406,7 @@ class OMPDistributeDirective : public OMPLoopDirective {
44234406
static OMPDistributeDirective *
44244407
Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
44254408
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
4426-
Stmt *AssociatedStmt, const HelperExprs &Exprs,
4427-
OpenMPDirectiveKind ParamPrevMappedDirective);
4409+
Stmt *AssociatedStmt, const HelperExprs &Exprs);
44284410

44294411
/// Creates an empty directive with the place
44304412
/// for \a NumClauses clauses.

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9875,11 +9875,6 @@ def err_break_not_in_loop_or_switch : Error<
98759875
def warn_loop_ctrl_binds_to_inner : Warning<
98769876
"'%0' is bound to current loop, GCC binds it to the enclosing loop">,
98779877
InGroup<GccCompat>;
9878-
def err_omp_bind_required_on_loop : Error<
9879-
"expected 'bind' clause for 'loop' construct without an enclosing OpenMP "
9880-
"construct">;
9881-
def err_omp_loop_reduction_clause : Error<
9882-
"'reduction' clause not allowed with '#pragma omp loop bind(teams)'">;
98839878
def warn_break_binds_to_switch : Warning<
98849879
"'break' is bound to loop, GCC binds it to switch">,
98859880
InGroup<GccCompat>;

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11185,23 +11185,6 @@ class Sema final {
1118511185
/// All `omp assumes` we encountered so far.
1118611186
SmallVector<AssumptionAttr *, 4> OMPAssumeGlobal;
1118711187

11188-
/// OMPD_loop is mapped to OMPD_for, OMPD_distribute or OMPD_simd depending
11189-
/// on the parameter of the bind clause. In the methods for the
11190-
/// mapped directives, check the parameters of the lastprivate clause.
11191-
bool checkLastPrivateForMappedDirectives(ArrayRef<OMPClause *> Clauses);
11192-
/// Depending on the bind clause of OMPD_loop map the directive to new
11193-
/// directives.
11194-
/// 1) loop bind(parallel) --> OMPD_for
11195-
/// 2) loop bind(teams) --> OMPD_distribute
11196-
/// 3) loop bind(thread) --> OMPD_simd
11197-
/// This is being handled in Sema instead of Codegen because of the need for
11198-
/// rigorous semantic checking in the new mapped directives.
11199-
bool mapLoopConstruct(llvm::SmallVector<OMPClause *> &ClausesWithoutBind,
11200-
ArrayRef<OMPClause *> Clauses,
11201-
OpenMPBindClauseKind BindKind,
11202-
OpenMPDirectiveKind &Kind,
11203-
OpenMPDirectiveKind &PrevMappedDirective);
11204-
1120511188
public:
1120611189
/// The declarator \p D defines a function in the scope \p S which is nested
1120711190
/// in an `omp begin/end declare variant` scope. In this method we create a
@@ -11497,8 +11480,7 @@ class Sema final {
1149711480
StmtResult ActOnOpenMPExecutableDirective(
1149811481
OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName,
1149911482
OpenMPDirectiveKind CancelRegion, ArrayRef<OMPClause *> Clauses,
11500-
Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc,
11501-
OpenMPDirectiveKind PrevMappedDirective = llvm::omp::OMPD_unknown);
11483+
Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc);
1150211484
/// Called on well-formed '\#pragma omp parallel' after parsing
1150311485
/// of the associated statement.
1150411486
StmtResult ActOnOpenMPParallelDirective(ArrayRef<OMPClause *> Clauses,

clang/lib/AST/Interp/Interp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ inline bool Invalid(InterpState &S, CodePtr OpPC) {
17861786
inline bool InvalidCast(InterpState &S, CodePtr OpPC, CastKind Kind) {
17871787
const SourceLocation &Loc = S.Current->getLocation(OpPC);
17881788
S.FFDiag(Loc, diag::note_constexpr_invalid_cast)
1789-
<< static_cast<uint8_t>(Kind) << S.Current->getRange(OpPC);
1789+
<< static_cast<unsigned>(Kind) << S.Current->getRange(OpPC);
17901790
return false;
17911791
}
17921792

clang/lib/AST/StmtOpenMP.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,11 @@ OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C,
297297
/*NumChildren=*/1);
298298
}
299299

300-
OMPSimdDirective *OMPSimdDirective::Create(
301-
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
302-
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
303-
const HelperExprs &Exprs, OpenMPDirectiveKind ParamPrevMappedDirective) {
300+
OMPSimdDirective *
301+
OMPSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc,
302+
SourceLocation EndLoc, unsigned CollapsedNum,
303+
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
304+
const HelperExprs &Exprs) {
304305
auto *Dir = createDirective<OMPSimdDirective>(
305306
C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_simd),
306307
StartLoc, EndLoc, CollapsedNum);
@@ -320,7 +321,6 @@ OMPSimdDirective *OMPSimdDirective::Create(
320321
Dir->setDependentInits(Exprs.DependentInits);
321322
Dir->setFinalsConditions(Exprs.FinalsConditions);
322323
Dir->setPreInits(Exprs.PreInits);
323-
Dir->setMappedDirective(ParamPrevMappedDirective);
324324
return Dir;
325325
}
326326

@@ -336,8 +336,7 @@ OMPSimdDirective *OMPSimdDirective::CreateEmpty(const ASTContext &C,
336336
OMPForDirective *OMPForDirective::Create(
337337
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
338338
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
339-
const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel,
340-
OpenMPDirectiveKind ParamPrevMappedDirective) {
339+
const HelperExprs &Exprs, Expr *TaskRedRef, bool HasCancel) {
341340
auto *Dir = createDirective<OMPForDirective>(
342341
C, Clauses, AssociatedStmt, numLoopChildren(CollapsedNum, OMPD_for) + 1,
343342
StartLoc, EndLoc, CollapsedNum);
@@ -367,7 +366,6 @@ OMPForDirective *OMPForDirective::Create(
367366
Dir->setPreInits(Exprs.PreInits);
368367
Dir->setTaskReductionRefExpr(TaskRedRef);
369368
Dir->setHasCancel(HasCancel);
370-
Dir->setMappedDirective(ParamPrevMappedDirective);
371369
return Dir;
372370
}
373371

@@ -1517,7 +1515,7 @@ OMPParallelMaskedTaskLoopSimdDirective::CreateEmpty(const ASTContext &C,
15171515
OMPDistributeDirective *OMPDistributeDirective::Create(
15181516
const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
15191517
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
1520-
const HelperExprs &Exprs, OpenMPDirectiveKind ParamPrevMappedDirective) {
1518+
const HelperExprs &Exprs) {
15211519
auto *Dir = createDirective<OMPDistributeDirective>(
15221520
C, Clauses, AssociatedStmt,
15231521
numLoopChildren(CollapsedNum, OMPD_distribute), StartLoc, EndLoc,
@@ -1546,7 +1544,6 @@ OMPDistributeDirective *OMPDistributeDirective::Create(
15461544
Dir->setDependentInits(Exprs.DependentInits);
15471545
Dir->setFinalsConditions(Exprs.FinalsConditions);
15481546
Dir->setPreInits(Exprs.PreInits);
1549-
Dir->setMappedDirective(ParamPrevMappedDirective);
15501547
return Dir;
15511548
}
15521549

0 commit comments

Comments
 (0)