Skip to content

Commit 728d8ae

Browse files
author
z1.cciauto
committed
merge main into amd-staging
2 parents 13a65d4 + 12a154a commit 728d8ae

File tree

216 files changed

+5138
-1784
lines changed

Some content is hidden

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

216 files changed

+5138
-1784
lines changed

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18+
build_type: [Debug, Release, MinSizeRel]
1819
include:
1920
- os: ubuntu-24.04
2021
ccache-variant: sccache
@@ -68,7 +69,7 @@ jobs:
6869
cmake -B ${{ steps.strings.outputs.build-output-dir }}
6970
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
7071
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
71-
-DCMAKE_BUILD_TYPE=MinSizeRel
72+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
7273
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
7374
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
7475
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }}

.github/workflows/libc-overlay-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
1717
fail-fast: false
1818
matrix:
19+
build_type: [Debug, Release, MinSizeRel]
1920
include:
2021
# TODO: add linux gcc when it is fixed
2122
- os: ubuntu-24.04
@@ -95,7 +96,7 @@ jobs:
9596
cmake -B ${{ steps.strings.outputs.build-output-dir }}
9697
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
9798
-DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
98-
-DCMAKE_BUILD_TYPE=MinSizeRel
99+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
99100
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
100101
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
101102
-DCMAKE_POLICY_DEFAULT_CMP0141=NEW

.github/workflows/premerge.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ on:
2121
- 'main'
2222
- 'release/**'
2323

24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
26+
cancel-in-progress: true
27+
2428
jobs:
2529
premerge-checks-linux:
2630
if: >-
2731
github.repository_owner == 'llvm' &&
2832
(github.event_name != 'pull_request' || github.event.action != 'closed')
2933
runs-on: llvm-premerge-linux-runners
30-
concurrency:
31-
group: ${{ github.workflow }}-linux-${{ github.event.pull_request.number || github.sha }}
32-
cancel-in-progress: true
3334
steps:
3435
- name: Checkout LLVM
3536
uses: actions/checkout@v4
@@ -88,9 +89,6 @@ jobs:
8889
github.repository_owner == 'llvm' &&
8990
(github.event_name != 'pull_request' || github.event.action != 'closed')
9091
runs-on: llvm-premerge-windows-runners
91-
concurrency:
92-
group: ${{ github.workflow }}-windows-${{ github.event.pull_request.number || github.sha }}
93-
cancel-in-progress: true
9492
defaults:
9593
run:
9694
shell: bash
@@ -148,9 +146,6 @@ jobs:
148146
149147
permerge-check-macos:
150148
runs-on: macos-14
151-
concurrency:
152-
group: ${{ github.workflow }}-macos-${{ github.event.pull_request.number || github.sha }}
153-
cancel-in-progress: true
154149
if: >-
155150
github.repository_owner == 'llvm' &&
156151
(startswith(github.ref_name, 'release/') ||

clang/docs/BoundsSafety.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,8 @@ that has the define.
959959
#if defined(__has_feature) && __has_feature(bounds_safety)
960960
#define __counted_by(T) __attribute__((__counted_by__(T)))
961961
// ... other bounds annotations
962-
#else #define __counted_by(T) // defined as nothing
962+
#else
963+
#define __counted_by(T) // defined as nothing
963964
// ... other bounds annotations
964965
#endif
965966
@@ -987,7 +988,7 @@ and it does not guarantee other types of memory safety properties. Consequently,
987988
it may not prevent some of the secondary bounds safety violations caused by
988989
other types of safety violations such as type confusion. For instance,
989990
``-fbounds-safety`` does not perform type-safety checks on conversions between
990-
`__single`` pointers of different pointee types (e.g., ``char *__single`` →
991+
``__single`` pointers of different pointee types (e.g., ``char *__single`` →
991992
``void *__single`` → ``int *__single``) beyond what the foundation languages
992993
(C/C++) already offer.
993994

@@ -1003,4 +1004,4 @@ Try it out
10031004

10041005
Your feedback on the programming model is valuable. You may want to follow the
10051006
instruction in :doc:`BoundsSafetyAdoptionGuide` to play with ``-fbounds-safety``
1006-
and please send your feedback to `Yeoul Na <mailto:yeoul_na@apple.com>`_.
1007+
and please send your feedback to `Yeoul Na <mailto:yeoul_na@apple.com>`_.

clang/docs/OpenMPSupport.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,9 @@ implementation.
416416
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
417417
| safe_sync and progress with identifier and API | :none:`unclaimed` | :none:`unclaimed` | |
418418
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
419-
| OpenMP directives in concurrent loop regions | :none:`unclaimed` | :none:`unclaimed` | |
419+
| OpenMP directives in concurrent loop regions | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/125621 |
420420
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
421-
| atomics constructs on concurrent loop regions | :none:`unclaimed` | :none:`unclaimed` | |
421+
| atomics constructs on concurrent loop regions | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/125621 |
422422
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
423423
| Loop construct with DO CONCURRENT | :none:`unclaimed` | :none:`unclaimed` | |
424424
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
@@ -456,9 +456,7 @@ implementation.
456456
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
457457
| map-type modifiers in arbitrary position | :none:`unclaimed` | :none:`unclaimed` | |
458458
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
459-
| atomic constructs in loop region | :none:`unclaimed` | :none:`unclaimed` | |
460-
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
461-
| Lift nesting restriction on concurrent loop | :none:`unclaimed` | :none:`unclaimed` | |
459+
| Lift nesting restriction on concurrent loop | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/125621 |
462460
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
463461
| priority clause for target constructs | :none:`unclaimed` | :none:`unclaimed` | |
464462
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+

clang/include/clang/AST/OperationKinds.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ CAST_OPERATION(HLSLVectorTruncation)
367367
// Non-decaying array RValue cast (HLSL only).
368368
CAST_OPERATION(HLSLArrayRValue)
369369

370+
// Aggregate by Value cast (HLSL only).
371+
CAST_OPERATION(HLSLElementwiseCast)
372+
370373
//===- Binary Operations -------------------------------------------------===//
371374
// Operators listed in order of precedence.
372375
// Note that additions to this should also update the StmtVisitor class,

clang/include/clang/ASTMatchers/ASTMatchers.h

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2489,7 +2489,28 @@ extern const internal::VariadicDynCastAllOfMatcher<Stmt, FloatingLiteral>
24892489
extern const internal::VariadicDynCastAllOfMatcher<Stmt, ImaginaryLiteral>
24902490
imaginaryLiteral;
24912491

2492-
/// Matches fixed point literals
2492+
/// Matches fixed-point literals eg.
2493+
/// 0.5r, 0.5hr, 0.5lr, 0.5uhr, 0.5ur, 0.5ulr
2494+
/// 1.0k, 1.0hk, 1.0lk, 1.0uhk, 1.0uk, 1.0ulk
2495+
/// Exponents 1.0e10k
2496+
/// Hexadecimal numbers 0x0.2p2r
2497+
///
2498+
/// Does not match implicit conversions such as first two lines:
2499+
/// \code
2500+
/// short _Accum sa = 2;
2501+
/// _Accum a = 12.5;
2502+
/// _Accum b = 1.25hk;
2503+
/// _Fract c = 0.25hr;
2504+
/// _Fract v = 0.35uhr;
2505+
/// _Accum g = 1.45uhk;
2506+
/// _Accum decexp1 = 1.575e1k;
2507+
/// \endcode
2508+
/// \compile_args{-ffixed-point;-std=c99}
2509+
///
2510+
/// The matcher \matcher{fixedPointLiteral()} matches
2511+
/// \match{1.25hk}, \match{0.25hr}, \match{0.35uhr},
2512+
/// \match{1.45uhk}, \match{1.575e1k}, but does not
2513+
/// match \nomatch{12.5} and \nomatch{2} from the code block.
24932514
extern const internal::VariadicDynCastAllOfMatcher<Stmt, FixedPointLiteral>
24942515
fixedPointLiteral;
24952516

clang/include/clang/ExtractAPI/ExtractAPIVisitor.h

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,11 +1146,29 @@ bool ExtractAPIVisitorBase<Derived>::VisitTypedefNameDecl(
11461146

11471147
StringRef Name = Decl->getName();
11481148

1149+
auto nameMatches = [&Name](TagDecl *TagDecl) {
1150+
StringRef TagName = TagDecl->getName();
1151+
1152+
if (TagName == Name)
1153+
return true;
1154+
1155+
// Also check whether the tag decl's name is the same as the typedef name
1156+
// with prefixed underscores
1157+
if (TagName.starts_with('_')) {
1158+
StringRef StrippedName = TagName.ltrim('_');
1159+
1160+
if (StrippedName == Name)
1161+
return true;
1162+
}
1163+
1164+
return false;
1165+
};
1166+
11491167
// If the underlying type was defined as part of the typedef modify it's
11501168
// fragments directly and pretend the typedef doesn't exist.
11511169
if (auto *TagDecl = Decl->getUnderlyingType()->getAsTagDecl()) {
11521170
if (TagDecl->isEmbeddedInDeclarator() && TagDecl->isCompleteDefinition() &&
1153-
Decl->getName() == TagDecl->getName()) {
1171+
nameMatches(TagDecl)) {
11541172
SmallString<128> TagUSR;
11551173
index::generateUSRForDecl(TagDecl, TagUSR);
11561174
if (auto *Record = API.findRecordForUSR(TagUSR)) {
@@ -1164,6 +1182,11 @@ bool ExtractAPIVisitorBase<Derived>::VisitTypedefNameDecl(
11641182
.append(Name, DeclarationFragments::FragmentKind::Identifier)
11651183
.appendSemicolon();
11661184

1185+
// Replace the name and subheading in case it's underscored so we can
1186+
// use the non-underscored version
1187+
Record->Name = Name;
1188+
Record->SubHeading = DeclarationFragmentsBuilder::getSubHeading(Decl);
1189+
11671190
return true;
11681191
}
11691192
}

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ class SemaHLSL : public SemaBase {
141141
// Diagnose whether the input ID is uint/unit2/uint3 type.
142142
bool diagnoseInputIDType(QualType T, const ParsedAttr &AL);
143143

144+
bool CanPerformScalarCast(QualType SrcTy, QualType DestTy);
145+
bool ContainsBitField(QualType BaseTy);
146+
bool CanPerformElementwiseCast(Expr *Src, QualType DestType);
144147
ExprResult ActOnOutParamExpr(ParmVarDecl *Param, Expr *Arg);
145148

146149
QualType getInoutParameterType(QualType Ty);

clang/lib/AST/Expr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,7 @@ bool CastExpr::CastConsistency() const {
19541954
case CK_FixedPointToBoolean:
19551955
case CK_HLSLArrayRValue:
19561956
case CK_HLSLVectorTruncation:
1957+
case CK_HLSLElementwiseCast:
19571958
CheckNoBasePath:
19581959
assert(path_empty() && "Cast kind should not have a base path!");
19591960
break;

0 commit comments

Comments
 (0)