Skip to content

Commit 24278bd

Browse files
author
z1_cciauto
authored
merge main into amd-staging (llvm#4066)
2 parents 39be8c6 + 28f1665 commit 24278bd

File tree

256 files changed

+5638
-2643
lines changed

Some content is hidden

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

256 files changed

+5638
-2643
lines changed

clang/cmake/modules/ClangConfig.cmake.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set(CLANG_EXPORTED_TARGETS "@CLANG_EXPORTS@")
1010
set(CLANG_CMAKE_DIR "@CLANG_CONFIG_CMAKE_DIR@")
1111
set(CLANG_INCLUDE_DIRS "@CLANG_CONFIG_INCLUDE_DIRS@")
1212
set(CLANG_LINK_CLANG_DYLIB "@CLANG_LINK_CLANG_DYLIB@")
13+
set(CLANG_DEFAULT_LINKER "@CLANG_DEFAULT_LINKER@")
1314

1415
# Provide all our library targets to users.
1516
@CLANG_CONFIG_INCLUDE_EXPORTS@

clang/docs/OpenMPSupport.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ and their implementation status. Please post on the
359359
information or if you want to help with the
360360
implementation.
361361

362+
362363
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
363364
|Feature | C/C++ Status | Fortran Status | Reviews |
364365
+=============================================================+===========================+===========================+==========================================================================+
@@ -405,6 +406,7 @@ implementation.
405406
| dispatch construct extension to support end directive | :none:`N/A` | :none:`unclaimed` | |
406407
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
407408

409+
408410
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
409411
|OpenMP 5.2 Deprecations | C/C++ Status | Fortran Status | Reviews |
410412
+=============================================================+===========================+===========================+==========================================================================+
@@ -444,6 +446,7 @@ and their implementation status. Please post on the
444446
information or if you want to help with the
445447
implementation.
446448

449+
447450
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
448451
|Feature | C/C++ Status | Fortran Status | Reviews |
449452
+=============================================================+===========================+===========================+==========================================================================+
@@ -580,7 +583,8 @@ implementation.
580583
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
581584
| Changes to omp_target_is_accessible | :part:`In Progress` | :part:`In Progress` | |
582585
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
583-
586+
| defaultmap implicit-behavior 'storage' | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/158336 |
587+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
584588

585589
.. _OpenMP 6.1 implementation details:
586590

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ OpenMP Support
786786
- Fixed non-contiguous strided update in the ``omp target update`` directive with the ``from`` clause.
787787
- Properly handle array section/assumed-size array privatization in C/C++.
788788
- Added support for ``variable-category`` modifier in ``default clause``.
789+
- Added support for ``defaultmap`` directive implicit-behavior ``storage``.
789790

790791
Improvements
791792
^^^^^^^^^^^^

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ CODEGENOPT(TimeTrace , 1, 0, Benign) ///< Set when -ftime-trace is enabl
322322
VALUE_CODEGENOPT(TimeTraceGranularity, 32, 500, Benign) ///< Minimum time granularity (in microseconds),
323323
///< traced by time profiler
324324
CODEGENOPT(InterchangeLoops , 1, 0, Benign) ///< Run loop-interchange.
325-
CODEGENOPT(FuseLoops , 1, 0, Benign) ///< Run loop-fusion.
326325
CODEGENOPT(UnrollLoops , 1, 0, Benign) ///< Control whether loops are unrolled.
327326
CODEGENOPT(RerollLoops , 1, 0, Benign) ///< Control whether loops are rerolled.
328327
CODEGENOPT(NoUseJumpTables , 1, 0, Benign) ///< Set when -fno-jump-tables is enabled.

clang/include/clang/Basic/OpenMPKinds.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ OPENMP_DEFAULTMAP_MODIFIER(firstprivate)
137137
OPENMP_DEFAULTMAP_MODIFIER(none)
138138
OPENMP_DEFAULTMAP_MODIFIER(default)
139139
OPENMP_DEFAULTMAP_MODIFIER(present)
140+
OPENMP_DEFAULTMAP_MODIFIER(storage)
140141

141142
// Static attributes for 'depend' clause.
142143
OPENMP_DEPEND_KIND(in)

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4439,10 +4439,6 @@ def floop_interchange : Flag<["-"], "floop-interchange">, Group<f_Group>,
44394439
HelpText<"Enable the loop interchange pass">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
44404440
def fno_loop_interchange: Flag<["-"], "fno-loop-interchange">, Group<f_Group>,
44414441
HelpText<"Disable the loop interchange pass">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
4442-
defm experimental_loop_fusion
4443-
: OptInCC1FFlag<"experimental-loop-fusion", "Enable", "Disable",
4444-
"Enable the loop fusion pass",
4445-
[ClangOption, FlangOption, FC1Option]>;
44464442
def funroll_loops : Flag<["-"], "funroll-loops">, Group<f_Group>,
44474443
HelpText<"Turn on loop unroller">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
44484444
def fno_unroll_loops : Flag<["-"], "fno-unroll-loops">, Group<f_Group>,

clang/include/clang/Sema/Sema.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2819,34 +2819,35 @@ class Sema final : public SemaBase {
28192819

28202820
/// BuiltinConstantArg - Handle a check if argument ArgNum of CallExpr
28212821
/// TheCall is a constant expression.
2822-
bool BuiltinConstantArg(CallExpr *TheCall, int ArgNum, llvm::APSInt &Result);
2822+
bool BuiltinConstantArg(CallExpr *TheCall, unsigned ArgNum,
2823+
llvm::APSInt &Result);
28232824

28242825
/// BuiltinConstantArgRange - Handle a check if argument ArgNum of CallExpr
28252826
/// TheCall is a constant expression in the range [Low, High].
2826-
bool BuiltinConstantArgRange(CallExpr *TheCall, int ArgNum, int Low, int High,
2827-
bool RangeIsError = true);
2827+
bool BuiltinConstantArgRange(CallExpr *TheCall, unsigned ArgNum, int Low,
2828+
int High, bool RangeIsError = true);
28282829

28292830
/// BuiltinConstantArgMultiple - Handle a check if argument ArgNum of CallExpr
28302831
/// TheCall is a constant expression is a multiple of Num..
2831-
bool BuiltinConstantArgMultiple(CallExpr *TheCall, int ArgNum,
2832+
bool BuiltinConstantArgMultiple(CallExpr *TheCall, unsigned ArgNum,
28322833
unsigned Multiple);
28332834

28342835
/// BuiltinConstantArgPower2 - Check if argument ArgNum of TheCall is a
28352836
/// constant expression representing a power of 2.
2836-
bool BuiltinConstantArgPower2(CallExpr *TheCall, int ArgNum);
2837+
bool BuiltinConstantArgPower2(CallExpr *TheCall, unsigned ArgNum);
28372838

28382839
/// BuiltinConstantArgShiftedByte - Check if argument ArgNum of TheCall is
28392840
/// a constant expression representing an arbitrary byte value shifted left by
28402841
/// a multiple of 8 bits.
2841-
bool BuiltinConstantArgShiftedByte(CallExpr *TheCall, int ArgNum,
2842+
bool BuiltinConstantArgShiftedByte(CallExpr *TheCall, unsigned ArgNum,
28422843
unsigned ArgBits);
28432844

28442845
/// BuiltinConstantArgShiftedByteOr0xFF - Check if argument ArgNum of
28452846
/// TheCall is a constant expression representing either a shifted byte value,
28462847
/// or a value of the form 0x??FF (i.e. a member of the arithmetic progression
28472848
/// 0x00FF, 0x01FF, ..., 0xFFFF). This strange range check is needed for some
28482849
/// Arm MVE intrinsics.
2849-
bool BuiltinConstantArgShiftedByteOrXXFF(CallExpr *TheCall, int ArgNum,
2850+
bool BuiltinConstantArgShiftedByteOrXXFF(CallExpr *TheCall, unsigned ArgNum,
28502851
unsigned ArgBits);
28512852

28522853
/// Checks that a call expression's argument count is at least the desired

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,7 +2429,7 @@ bool Compiler<Emitter>::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *E) {
24292429
// and the RHS is our SubExpr.
24302430
for (size_t I = 0; I != Size; ++I) {
24312431
ArrayIndexScope<Emitter> IndexScope(this, I);
2432-
BlockScope<Emitter> BS(this);
2432+
LocalScope<Emitter> BS(this);
24332433

24342434
if (!this->visitArrayElemInit(I, SubExpr, SubExprT))
24352435
return false;
@@ -4140,7 +4140,7 @@ bool Compiler<Emitter>::VisitCXXStdInitializerListExpr(
41404140

41414141
template <class Emitter>
41424142
bool Compiler<Emitter>::VisitStmtExpr(const StmtExpr *E) {
4143-
BlockScope<Emitter> BS(this);
4143+
LocalScope<Emitter> BS(this);
41444144
StmtExprScope<Emitter> SS(this);
41454145

41464146
const CompoundStmt *CS = E->getSubStmt();
@@ -5111,7 +5111,7 @@ bool Compiler<Emitter>::VisitCallExpr(const CallExpr *E) {
51115111
}
51125112
}
51135113

5114-
BlockScope<Emitter> CallScope(this, ScopeKind::Call);
5114+
LocalScope<Emitter> CallScope(this, ScopeKind::Call);
51155115

51165116
QualType ReturnType = E->getCallReturnType(Ctx.getASTContext());
51175117
OptPrimType T = classify(ReturnType);
@@ -5475,7 +5475,7 @@ template <class Emitter> bool Compiler<Emitter>::visitStmt(const Stmt *S) {
54755475

54765476
template <class Emitter>
54775477
bool Compiler<Emitter>::visitCompoundStmt(const CompoundStmt *S) {
5478-
BlockScope<Emitter> Scope(this);
5478+
LocalScope<Emitter> Scope(this);
54795479
for (const auto *InnerStmt : S->body())
54805480
if (!visitStmt(InnerStmt))
54815481
return false;
@@ -6211,7 +6211,7 @@ bool Compiler<Emitter>::compileConstructor(const CXXConstructorDecl *Ctor) {
62116211
InitLinkScope<Emitter> InitScope(this, InitLink::This());
62126212
for (const auto *Init : Ctor->inits()) {
62136213
// Scope needed for the initializers.
6214-
BlockScope<Emitter> Scope(this);
6214+
LocalScope<Emitter> Scope(this);
62156215

62166216
const Expr *InitExpr = Init->getInit();
62176217
if (const FieldDecl *Member = Init->getMember()) {

clang/lib/AST/ByteCode/Compiler.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -624,14 +624,6 @@ template <class Emitter> class LocalScope : public VariableScope<Emitter> {
624624
UnsignedOrNone Idx = std::nullopt;
625625
};
626626

627-
/// Scope for storage declared in a compound statement.
628-
// FIXME: Remove?
629-
template <class Emitter> class BlockScope final : public LocalScope<Emitter> {
630-
public:
631-
BlockScope(Compiler<Emitter> *Ctx, ScopeKind Kind = ScopeKind::Block)
632-
: LocalScope<Emitter>(Ctx, Kind) {}
633-
};
634-
635627
template <class Emitter> class ArrayIndexScope final {
636628
public:
637629
ArrayIndexScope(Compiler<Emitter> *Ctx, uint64_t Index) : Ctx(Ctx) {

clang/lib/Basic/OpenMPKinds.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,18 @@ unsigned clang::getOpenMPSimpleClauseType(OpenMPClauseKind Kind, StringRef Str,
110110
#define OPENMP_DIST_SCHEDULE_KIND(Name) .Case(#Name, OMPC_DIST_SCHEDULE_##Name)
111111
#include "clang/Basic/OpenMPKinds.def"
112112
.Default(OMPC_DIST_SCHEDULE_unknown);
113-
case OMPC_defaultmap:
114-
return llvm::StringSwitch<unsigned>(Str)
113+
case OMPC_defaultmap: {
114+
unsigned Type = llvm::StringSwitch<unsigned>(Str)
115115
#define OPENMP_DEFAULTMAP_KIND(Name) \
116116
.Case(#Name, static_cast<unsigned>(OMPC_DEFAULTMAP_##Name))
117117
#define OPENMP_DEFAULTMAP_MODIFIER(Name) \
118118
.Case(#Name, static_cast<unsigned>(OMPC_DEFAULTMAP_MODIFIER_##Name))
119119
#include "clang/Basic/OpenMPKinds.def"
120-
.Default(OMPC_DEFAULTMAP_unknown);
120+
.Default(OMPC_DEFAULTMAP_unknown);
121+
if (LangOpts.OpenMP < 60 && Type == OMPC_DEFAULTMAP_MODIFIER_storage)
122+
return OMPC_DEFAULTMAP_MODIFIER_unknown;
123+
return Type;
124+
}
121125
case OMPC_atomic_default_mem_order:
122126
return llvm::StringSwitch<OpenMPAtomicDefaultMemOrderClauseKind>(Str)
123127
#define OPENMP_ATOMIC_DEFAULT_MEM_ORDER_KIND(Name) \

0 commit comments

Comments
 (0)