Skip to content

Commit 7005222

Browse files
committed
merge main into amd-staging
2 parents 8280541 + 84e3c6f commit 7005222

File tree

158 files changed

+4270
-4288
lines changed

Some content is hidden

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

158 files changed

+4270
-4288
lines changed

clang/bindings/python/clang/cindex.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,9 +1410,6 @@ def is_unexposed(self):
14101410
# OpenMP scope directive.
14111411
OMP_SCOPE_DIRECTIVE = 306
14121412

1413-
# OpenMP stripe directive.
1414-
OMP_STRIPE_DIRECTIVE = 310
1415-
14161413
# OpenACC Compute Construct.
14171414
OPEN_ACC_COMPUTE_DIRECTIVE = 320
14181415

clang/cmake/modules/AddClang.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ macro(add_clang_library name)
138138
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
139139
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
140140

141+
if (LLVM_ENABLE_PDB)
142+
install(FILES $<TARGET_PDB_FILE:${name}> DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name} OPTIONAL)
143+
endif()
144+
141145
if (NOT LLVM_ENABLE_IDE)
142146
add_llvm_install_targets(install-${lib}
143147
DEPENDS ${lib}

clang/docs/OpenMPSupport.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,6 @@ implementation.
374374
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
375375
| Loop transformation constructs | :none:`unclaimed` | :none:`unclaimed` | |
376376
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
377-
| loop stripe transformation | :good:`done` | https://github.com/llvm/llvm-project/pull/119891 |
378-
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
379377
| work distribute construct | :none:`unclaimed` | :none:`unclaimed` | |
380378
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
381379
| task_iteration | :none:`unclaimed` | :none:`unclaimed` | |

clang/docs/ReleaseNotes.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ Python Binding Changes
291291
OpenMP Support
292292
--------------
293293
- Added support 'no_openmp_constructs' assumption clause.
294-
- Added support for 'omp stripe' directive.
295294

296295
Improvements
297296
^^^^^^^^^^^^

clang/include/clang-c/Index.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,10 +2158,6 @@ enum CXCursorKind {
21582158
*/
21592159
CXCursor_OMPAssumeDirective = 309,
21602160

2161-
/** OpenMP assume directive.
2162-
*/
2163-
CXCursor_OMPStripeDirective = 310,
2164-
21652161
/** OpenACC Compute Construct.
21662162
*/
21672163
CXCursor_OpenACCComputeConstruct = 320,

clang/include/clang/AST/RecursiveASTVisitor.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3056,9 +3056,6 @@ DEF_TRAVERSE_STMT(OMPSimdDirective,
30563056
DEF_TRAVERSE_STMT(OMPTileDirective,
30573057
{ TRY_TO(TraverseOMPExecutableDirective(S)); })
30583058

3059-
DEF_TRAVERSE_STMT(OMPStripeDirective,
3060-
{ TRY_TO(TraverseOMPExecutableDirective(S)); })
3061-
30623059
DEF_TRAVERSE_STMT(OMPUnrollDirective,
30633060
{ TRY_TO(TraverseOMPExecutableDirective(S)); })
30643061

clang/include/clang/AST/StmtOpenMP.h

Lines changed: 2 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -994,9 +994,7 @@ class OMPLoopTransformationDirective : public OMPLoopBasedDirective {
994994
static bool classof(const Stmt *T) {
995995
Stmt::StmtClass C = T->getStmtClass();
996996
return C == OMPTileDirectiveClass || C == OMPUnrollDirectiveClass ||
997-
C == OMPReverseDirectiveClass || C == OMPInterchangeDirectiveClass ||
998-
C == OMPStripeDirectiveClass;
999-
;
997+
C == OMPReverseDirectiveClass || C == OMPInterchangeDirectiveClass;
1000998
}
1001999
};
10021000

@@ -5562,7 +5560,7 @@ class OMPTileDirective final : public OMPLoopTransformationDirective {
55625560
: OMPLoopTransformationDirective(OMPTileDirectiveClass,
55635561
llvm::omp::OMPD_tile, StartLoc, EndLoc,
55645562
NumLoops) {
5565-
setNumGeneratedLoops(2 * NumLoops);
5563+
setNumGeneratedLoops(3 * NumLoops);
55665564
}
55675565

55685566
void setPreInits(Stmt *PreInits) {
@@ -5623,82 +5621,6 @@ class OMPTileDirective final : public OMPLoopTransformationDirective {
56235621
}
56245622
};
56255623

5626-
/// This represents the '#pragma omp stripe' loop transformation directive.
5627-
class OMPStripeDirective final : public OMPLoopTransformationDirective {
5628-
friend class ASTStmtReader;
5629-
friend class OMPExecutableDirective;
5630-
5631-
/// Default list of offsets.
5632-
enum {
5633-
PreInitsOffset = 0,
5634-
TransformedStmtOffset,
5635-
};
5636-
5637-
explicit OMPStripeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
5638-
unsigned NumLoops)
5639-
: OMPLoopTransformationDirective(OMPStripeDirectiveClass,
5640-
llvm::omp::OMPD_stripe, StartLoc, EndLoc,
5641-
NumLoops) {
5642-
setNumGeneratedLoops(2 * NumLoops);
5643-
}
5644-
5645-
void setPreInits(Stmt *PreInits) {
5646-
Data->getChildren()[PreInitsOffset] = PreInits;
5647-
}
5648-
5649-
void setTransformedStmt(Stmt *S) {
5650-
Data->getChildren()[TransformedStmtOffset] = S;
5651-
}
5652-
5653-
public:
5654-
/// Create a new AST node representation for '#pragma omp stripe'.
5655-
///
5656-
/// \param C Context of the AST.
5657-
/// \param StartLoc Location of the introducer (e.g. the 'omp' token).
5658-
/// \param EndLoc Location of the directive's end (e.g. the tok::eod).
5659-
/// \param Clauses The directive's clauses.
5660-
/// \param NumLoops Number of associated loops (number of items in the
5661-
/// 'sizes' clause).
5662-
/// \param AssociatedStmt The outermost associated loop.
5663-
/// \param TransformedStmt The loop nest after striping, or nullptr in
5664-
/// dependent contexts.
5665-
/// \param PreInits Helper preinits statements for the loop nest.
5666-
static OMPStripeDirective *
5667-
Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
5668-
ArrayRef<OMPClause *> Clauses, unsigned NumLoops, Stmt *AssociatedStmt,
5669-
Stmt *TransformedStmt, Stmt *PreInits);
5670-
5671-
/// Build an empty '#pragma omp stripe' AST node for deserialization.
5672-
///
5673-
/// \param C Context of the AST.
5674-
/// \param NumClauses Number of clauses to allocate.
5675-
/// \param NumLoops Number of associated loops to allocate.
5676-
static OMPStripeDirective *
5677-
CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned NumLoops);
5678-
5679-
/// Gets/sets the associated loops after striping.
5680-
///
5681-
/// This is in de-sugared format stored as a CompoundStmt.
5682-
///
5683-
/// \code
5684-
/// for (...)
5685-
/// ...
5686-
/// \endcode
5687-
///
5688-
/// Note that if the generated loops a become associated loops of another
5689-
/// directive, they may need to be hoisted before them.
5690-
Stmt *getTransformedStmt() const {
5691-
return Data->getChildren()[TransformedStmtOffset];
5692-
}
5693-
5694-
/// Return preinits statement.
5695-
Stmt *getPreInits() const { return Data->getChildren()[PreInitsOffset]; }
5696-
5697-
static bool classof(const Stmt *T) {
5698-
return T->getStmtClass() == OMPStripeDirectiveClass;
5699-
}
5700-
};
5701-
57025624
/// This represents the '#pragma omp unroll' loop transformation directive.
57035625
///
57045626
/// \code

clang/include/clang/Basic/FPOptions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ OPTION(FPEvalMethod, LangOptions::FPEvalMethodKind, 2, AllowApproxFunc)
2828
OPTION(Float16ExcessPrecision, LangOptions::ExcessPrecisionKind, 2, FPEvalMethod)
2929
OPTION(BFloat16ExcessPrecision, LangOptions::ExcessPrecisionKind, 2, Float16ExcessPrecision)
3030
OPTION(MathErrno, bool, 1, BFloat16ExcessPrecision)
31-
OPTION(ComplexRange, LangOptions::ComplexRangeKind, 2, MathErrno)
31+
OPTION(ComplexRange, LangOptions::ComplexRangeKind, 3, MathErrno)
3232
#undef OPTION

clang/include/clang/Basic/LangOptions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ BENIGN_LANGOPT(NoSignedZero , 1, 0, "Permit Floating Point optimization wit
238238
BENIGN_LANGOPT(AllowRecip , 1, 0, "Permit Floating Point reciprocal")
239239
BENIGN_LANGOPT(ApproxFunc , 1, 0, "Permit Floating Point approximation")
240240

241-
ENUM_LANGOPT(ComplexRange, ComplexRangeKind, 2, CX_None, "Enable use of range reduction for complex arithmetics.")
241+
ENUM_LANGOPT(ComplexRange, ComplexRangeKind, 3, CX_None, "Enable use of range reduction for complex arithmetics.")
242242

243243
BENIGN_LANGOPT(ObjCGCBitmapPrint , 1, 0, "printing of GC's bitmap layout for __weak/__strong ivars")
244244

clang/include/clang/Basic/LangOptions.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,12 @@ class LangOptions : public LangOptionsBase {
648648

649649
// Define accessors/mutators for language options of enumeration type.
650650
#define LANGOPT(Name, Bits, Default, Description)
651-
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
652-
Type get##Name() const { return static_cast<Type>(Name); } \
653-
void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
651+
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
652+
Type get##Name() const { return static_cast<Type>(Name); } \
653+
void set##Name(Type Value) { \
654+
assert(static_cast<unsigned>(Value) < (1u << Bits)); \
655+
Name = static_cast<unsigned>(Value); \
656+
}
654657
#include "clang/Basic/LangOptions.def"
655658

656659
/// Are we compiling a module?
@@ -959,11 +962,14 @@ class FPOptions {
959962
void applyChanges(FPOptionsOverride FPO);
960963

961964
// We can define most of the accessors automatically:
965+
// TODO: consider enforcing the assertion that value fits within bits
966+
// statically.
962967
#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
963968
TYPE get##NAME() const { \
964969
return static_cast<TYPE>((Value & NAME##Mask) >> NAME##Shift); \
965970
} \
966971
void set##NAME(TYPE value) { \
972+
assert(storage_type(value) < (1u << WIDTH)); \
967973
Value = (Value & ~NAME##Mask) | (storage_type(value) << NAME##Shift); \
968974
}
969975
#include "clang/Basic/FPOptions.def"

0 commit comments

Comments
 (0)