Skip to content

Commit 10600d1

Browse files
committed
Merge from 'main' to 'sycl-web' (87 commits)
CONFLICT (content): Merge conflict in libclc/clc/lib/amdgcn/SOURCES CONFLICT (content): Merge conflict in libclc/clc/lib/ptx-nvidiacl/SOURCES
2 parents 0733abb + af16fc2 commit 10600d1

File tree

318 files changed

+11300
-3583
lines changed

Some content is hidden

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

318 files changed

+11300
-3583
lines changed

.ci/compute_projects_test.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,34 @@ def test_ci(self):
284284
"check-cxx check-cxxabi check-unwind",
285285
)
286286

287+
def test_windows_ci(self):
288+
env_variables = compute_projects.get_env_variables(
289+
[".ci/compute_projects.py"], "Windows"
290+
)
291+
self.assertEqual(
292+
env_variables["projects_to_build"],
293+
"clang;clang-tools-extra;libclc;lld;llvm;mlir;polly",
294+
)
295+
self.assertEqual(
296+
env_variables["project_check_targets"],
297+
"check-clang check-clang-cir check-clang-tools check-lld check-llvm check-mlir check-polly",
298+
)
299+
self.assertEqual(
300+
env_variables["runtimes_to_build"],
301+
"libcxx;libcxxabi;libunwind",
302+
)
303+
self.assertEqual(
304+
env_variables["runtimes_check_targets"],
305+
"",
306+
)
307+
# TODO(boomanaiden154): We should not be emitting these on Windows.
308+
# It does not currently impact anything because we do not build the
309+
# runtimes on Windows though.
310+
self.assertEqual(
311+
env_variables["runtimes_check_targets_needs_reconfig"],
312+
"check-cxx check-cxxabi check-unwind",
313+
)
314+
287315
def test_lldb(self):
288316
env_variables = compute_projects.get_env_variables(
289317
["lldb/CMakeLists.txt"], "Linux"

clang/docs/HardwareAssistedAddressSanitizerDesign.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ implement page aliasing.
291291

292292
Related Work
293293
============
294-
* `SPARC ADI`_ implements a similar tool mostly in hardware.
294+
* `SPARC ADI`_ and `Arm MTE`_ implement a similar tool mostly in hardware.
295295
* `Effective and Efficient Memory Protection Using Dynamic Tainting`_ discusses
296296
similar approaches ("lock & key").
297297
* `Watchdog`_ discussed a heavier, but still somewhat similar
@@ -302,6 +302,7 @@ Related Work
302302
.. _Watchdog: https://www.cis.upenn.edu/acg/papers/isca12_watchdog.pdf
303303
.. _Effective and Efficient Memory Protection Using Dynamic Tainting: https://www.cc.gatech.edu/~orso/papers/clause.doudalis.orso.prvulovic.pdf
304304
.. _SPARC ADI: https://lazytyped.blogspot.com/2017/09/getting-started-with-adi.html
305+
.. _Arm MTE: https://developer.arm.com/documentation/108035/0100/Introduction-to-the-Memory-Tagging-Extension
305306
.. _AddressSanitizer paper: https://www.usenix.org/system/files/conference/atc12/atc12-final39.pdf
306307
.. _Address Tagging: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0024a/ch12s05s01.html
307308
.. _Linear Address Masking: https://software.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html

clang/docs/ReleaseNotes.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,26 @@ C++ Specific Potentially Breaking Changes
4545
regressions if your build system supports two-phase compilation model but haven't support
4646
reduced BMI or it is a compiler bug or a bug in users code.
4747

48+
- Clang now correctly diagnoses during constant expression evaluation undefined behavior due to member
49+
pointer access to a member which is not a direct or indirect member of the most-derived object
50+
of the accessed object but is instead located directly in a sibling class to one of the classes
51+
along the inheritance hierarchy of the most-derived object as ill-formed.
52+
Other scenarios in which the member is not member of the most derived object were already
53+
diagnosed previously. (#GH150709)
54+
55+
.. code-block:: c++
56+
57+
struct A {};
58+
struct B : A {};
59+
struct C : A { constexpr int foo() const { return 1; } };
60+
constexpr A a;
61+
constexpr B b;
62+
constexpr C c;
63+
constexpr auto mp = static_cast<int(A::*)() const>(&C::foo);
64+
static_assert((a.*mp)() == 1); // continues to be rejected
65+
static_assert((b.*mp)() == 1); // newly rejected
66+
static_assert((c.*mp)() == 1); // accepted
67+
4868
ABI Changes in This Version
4969
---------------------------
5070

clang/docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Design Documents
117117
OffloadingDesign
118118
PCHInternals
119119
ItaniumMangleAbiTags
120+
ControlFlowIntegrityDesign
120121
HardwareAssistedAddressSanitizerDesign.rst
121122
ConstantInterpreter
122123

clang/include/clang/AST/OpenACCClause.h

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,23 +878,46 @@ class OpenACCPrivateClause final
878878

879879
class OpenACCFirstPrivateClause final
880880
: public OpenACCClauseWithVarList,
881-
private llvm::TrailingObjects<OpenACCFirstPrivateClause, Expr *> {
881+
private llvm::TrailingObjects<OpenACCFirstPrivateClause, Expr *,
882+
VarDecl *> {
882883
friend TrailingObjects;
883884

884885
OpenACCFirstPrivateClause(SourceLocation BeginLoc, SourceLocation LParenLoc,
885-
ArrayRef<Expr *> VarList, SourceLocation EndLoc)
886+
ArrayRef<Expr *> VarList,
887+
ArrayRef<VarDecl *> InitRecipes,
888+
SourceLocation EndLoc)
886889
: OpenACCClauseWithVarList(OpenACCClauseKind::FirstPrivate, BeginLoc,
887890
LParenLoc, EndLoc) {
888-
setExprs(getTrailingObjects(VarList.size()), VarList);
891+
assert(VarList.size() == InitRecipes.size());
892+
setExprs(getTrailingObjects<Expr *>(VarList.size()), VarList);
893+
llvm::uninitialized_copy(InitRecipes, getTrailingObjects<VarDecl *>());
889894
}
890895

891896
public:
892897
static bool classof(const OpenACCClause *C) {
893898
return C->getClauseKind() == OpenACCClauseKind::FirstPrivate;
894899
}
900+
901+
// Gets a list of 'made up' `VarDecl` objects that can be used by codegen to
902+
// ensure that we properly initialize each of these variables.
903+
ArrayRef<VarDecl *> getInitRecipes() {
904+
return ArrayRef<VarDecl *>{getTrailingObjects<VarDecl *>(),
905+
getExprs().size()};
906+
}
907+
908+
ArrayRef<VarDecl *> getInitRecipes() const {
909+
return ArrayRef<VarDecl *>{getTrailingObjects<VarDecl *>(),
910+
getExprs().size()};
911+
}
912+
895913
static OpenACCFirstPrivateClause *
896914
Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
897-
ArrayRef<Expr *> VarList, SourceLocation EndLoc);
915+
ArrayRef<Expr *> VarList, ArrayRef<VarDecl *> InitRecipes,
916+
SourceLocation EndLoc);
917+
918+
size_t numTrailingObjects(OverloadToken<Expr *>) const {
919+
return getExprs().size();
920+
}
898921
};
899922

900923
class OpenACCDevicePtrClause final

clang/include/clang/Basic/Attr.td

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5937,6 +5937,14 @@ def HLSLSV_GroupIndex: HLSLAnnotationAttr {
59375937
let Documentation = [HLSLSV_GroupIndexDocs];
59385938
}
59395939

5940+
def HLSLVkBinding : InheritableAttr {
5941+
let Spellings = [CXX11<"vk", "binding">];
5942+
let Subjects = SubjectList<[HLSLBufferObj, ExternalGlobalVar], ErrorDiag>;
5943+
let Args = [IntArgument<"Binding">, IntArgument<"Set", 1>];
5944+
let LangOpts = [HLSL];
5945+
let Documentation = [HLSLVkBindingDocs];
5946+
}
5947+
59405948
def HLSLResourceBinding: InheritableAttr {
59415949
let Spellings = [HLSLAnnotation<"register">];
59425950
let Subjects = SubjectList<[HLSLBufferObj, ExternalGlobalVar], ErrorDiag>;

clang/include/clang/Basic/AttrDocs.td

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10518,6 +10518,32 @@ def ReadOnlyPlacementDocs : Documentation {
1051810518
}];
1051910519
}
1052010520

10521+
def HLSLVkBindingDocs : Documentation {
10522+
let Category = DocCatVariable;
10523+
let Content = [{
10524+
The ``[[vk::binding]]`` attribute allows you to explicitly specify the descriptor
10525+
set and binding for a resource when targeting SPIR-V. This is particularly
10526+
useful when you need different bindings for SPIR-V and DXIL, as the ``register``
10527+
attribute can be used for DXIL-specific bindings.
10528+
10529+
The attribute takes two integer arguments: the binding and the descriptor set.
10530+
The descriptor set is optional and defaults to 0 if not provided.
10531+
10532+
.. code-block:: c++
10533+
10534+
// A structured buffer with binding 23 in descriptor set 102.
10535+
[[vk::binding(23, 102)]] StructuredBuffer<float> Buf;
10536+
10537+
// A structured buffer with binding 14 in descriptor set 0.
10538+
[[vk::binding(14)]] StructuredBuffer<float> Buf2;
10539+
10540+
// A cbuffer with binding 1 in descriptor set 2.
10541+
[[vk::binding(1, 2)]] cbuffer MyCBuffer {
10542+
float4x4 worldViewProj;
10543+
};
10544+
}];
10545+
}
10546+
1052110547
def WebAssemblyFuncrefDocs : Documentation {
1052210548
let Category = DocCatType;
1052310549
let Content = [{

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ BUILTIN(__builtin_amdgcn_raw_buffer_load_b64, "V2UiQbiiIi", "n")
163163
BUILTIN(__builtin_amdgcn_raw_buffer_load_b96, "V3UiQbiiIi", "n")
164164
BUILTIN(__builtin_amdgcn_raw_buffer_load_b128, "V4UiQbiiIi", "n")
165165

166+
BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_add_i32, "iiQbiiIi", "t")
167+
168+
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fadd_f32, "ffQbiiIi", "t", "atomic-fadd-rtn-insts")
169+
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16, "V2hV2hQbiiIi", "t", "atomic-buffer-global-pk-add-f16-insts")
170+
171+
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmin_f32, "ffQbiiIi", "t", "atomic-fmin-fmax-global-f32")
172+
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f32, "ffQbiiIi", "t", "atomic-fmin-fmax-global-f32")
173+
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmin_f64, "ddQbiiIi", "t", "atomic-fmin-fmax-global-f64")
174+
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f64, "ddQbiiIi", "t", "atomic-fmin-fmax-global-f64")
175+
166176
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_load_lds, "vQbv*3IUiiiIiIi", "t", "vmem-to-lds-load-insts")
167177
TARGET_BUILTIN(__builtin_amdgcn_struct_ptr_buffer_load_lds, "vQbv*3IUiiiiIiIi", "t", "vmem-to-lds-load-insts")
168178

@@ -800,6 +810,8 @@ TARGET_BUILTIN(__builtin_amdgcn_wmma_scale16_f32_16x16x128_f8f6f4, "V8fIiV16iIiV
800810
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x32_f16, "V8fIbV16hIbV16hIsV8fIbIb", "nc", "gfx1250-insts,wavefrontsize32")
801811
TARGET_BUILTIN(__builtin_amdgcn_wmma_f16_16x16x32_f16, "V8hIbV16hIbV16hIsV8hIbIb", "nc", "gfx1250-insts,wavefrontsize32")
802812
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_32x16x128_f4, "V16fV16iV8iIsV16f", "nc", "gfx1250-insts,wavefrontsize32")
813+
TARGET_BUILTIN(__builtin_amdgcn_wmma_scale_f32_32x16x128_f4, "V16fV16iV8iIsV16fIiIiiIiIiiIbIb", "nc", "gfx1250-insts,wavefrontsize32")
814+
TARGET_BUILTIN(__builtin_amdgcn_wmma_scale16_f32_32x16x128_f4, "V16fV16iV8iIsV16fIiIiLiIiIiLiIbIb", "nc", "gfx1250-insts,wavefrontsize32")
803815
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x64_bf16, "V8fIbV16yIbV32yV8fiIbIb", "nc", "gfx1250-insts,wavefrontsize32")
804816
TARGET_BUILTIN(__builtin_amdgcn_swmmac_bf16_16x16x64_bf16, "V8yIbV16yIbV32yV8yiIbIb", "nc", "gfx1250-insts,wavefrontsize32")
805817
TARGET_BUILTIN(__builtin_amdgcn_swmmac_bf16f32_16x16x64_bf16, "V8fIbV16yIbV32yV8fiIbIb", "nc", "gfx1250-insts,wavefrontsize32")

clang/include/clang/Parse/Parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5198,7 +5198,7 @@ class Parser : public CodeCompletionHandler {
51985198
void ParseHLSLAnnotations(ParsedAttributes &Attrs,
51995199
SourceLocation *EndLoc = nullptr,
52005200
bool CouldBeBitField = false);
5201-
Decl *ParseHLSLBuffer(SourceLocation &DeclEnd);
5201+
Decl *ParseHLSLBuffer(SourceLocation &DeclEnd, ParsedAttributes &Attrs);
52025202

52035203
///@}
52045204

clang/include/clang/Sema/SemaHLSL.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ class SemaHLSL : public SemaBase {
161161
void handleNumThreadsAttr(Decl *D, const ParsedAttr &AL);
162162
void handleWaveSizeAttr(Decl *D, const ParsedAttr &AL);
163163
void handleVkConstantIdAttr(Decl *D, const ParsedAttr &AL);
164+
void handleVkBindingAttr(Decl *D, const ParsedAttr &AL);
164165
void handleSV_DispatchThreadIDAttr(Decl *D, const ParsedAttr &AL);
165166
void handleSV_GroupThreadIDAttr(Decl *D, const ParsedAttr &AL);
166167
void handleSV_GroupIDAttr(Decl *D, const ParsedAttr &AL);

0 commit comments

Comments
 (0)