Skip to content

Commit a60d6c8

Browse files
committed
merge main into amd-staging
2 parents 4482bc1 + 7e04bfb commit a60d6c8

File tree

122 files changed

+2546
-1096
lines changed

Some content is hidden

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

122 files changed

+2546
-1096
lines changed

clang-tools-extra/clang-doc/BitcodeReader.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,17 @@ static llvm::Error addReference(T I, Reference &&R, FieldId F) {
569569
"invalid type cannot contain Reference");
570570
}
571571

572+
template <> llvm::Error addReference(VarInfo *I, Reference &&R, FieldId F) {
573+
switch (F) {
574+
case FieldId::F_namespace:
575+
I->Namespace.emplace_back(std::move(R));
576+
return llvm::Error::success();
577+
default:
578+
return llvm::createStringError(llvm::inconvertibleErrorCode(),
579+
"VarInfo cannot contain this Reference");
580+
}
581+
}
582+
572583
template <> llvm::Error addReference(TypeInfo *I, Reference &&R, FieldId F) {
573584
switch (F) {
574585
case FieldId::F_type:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// RUN: rm -rf %t && mkdir -p %t
2+
// RUN: clang-doc --output=%t --format=json --executor=standalone %s
3+
// RUN: FileCheck %s < %t/nested/index.json --check-prefix=NESTED
4+
// RUN: FileCheck %s < %t/nested/inner/index.json --check-prefix=INNER
5+
6+
namespace nested {
7+
int Global;
8+
namespace inner {
9+
int InnerGlobal;
10+
} // namespace inner
11+
} // namespace nested
12+
13+
// NESTED: "Variables": [
14+
// NESTED-NEXT: {
15+
// NESTED-NEXT: "IsStatic": false,
16+
// NESTED-NEXT: "Location": {
17+
// NESTED-NEXT: "Filename": "{{.*}}nested-namespace.cpp",
18+
// NESTED-NEXT: "LineNumber": 7
19+
// NESTED-NEXT: },
20+
// NESTED-NEXT: "Name": "Global",
21+
// NESTED-NEXT: "Namespace": [
22+
// NESTED-NEXT: "nested"
23+
// NESTED-NEXT: ],
24+
25+
// INNER: "Variables": [
26+
// INNER-NEXT: {
27+
// INNER-NEXT: "IsStatic": false,
28+
// INNER-NEXT: "Location": {
29+
// INNER-NEXT: "Filename": "{{.*}}nested-namespace.cpp",
30+
// INNER-NEXT: "LineNumber": 9
31+
// INNER-NEXT: },
32+
// INNER-NEXT: "Name": "InnerGlobal",
33+
// INNER-NEXT: "Namespace": [
34+
// INNER-NEXT: "inner",
35+
// INNER-NEXT: "nested"
36+
// INNER-NEXT: ],

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,8 @@ Arm and AArch64 Support
992992

993993
- For AArch64, added support for generating executable-only code sections by using the
994994
``-mexecute-only`` or ``-mpure-code`` compiler flags. (#GH125688)
995+
- Added ``-msve-streaming-vector-bits=`` flag, which allows specifying the
996+
SVE vector width in streaming mode.
995997

996998
Android Support
997999
^^^^^^^^^^^^^^^

clang/include/clang/AST/Decl.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -888,13 +888,17 @@ struct EvaluatedStmt {
888888
bool HasICEInit : 1;
889889
bool CheckedForICEInit : 1;
890890

891+
bool HasSideEffects : 1;
892+
bool CheckedForSideEffects : 1;
893+
891894
LazyDeclStmtPtr Value;
892895
APValue Evaluated;
893896

894897
EvaluatedStmt()
895898
: WasEvaluated(false), IsEvaluating(false),
896899
HasConstantInitialization(false), HasConstantDestruction(false),
897-
HasICEInit(false), CheckedForICEInit(false) {}
900+
HasICEInit(false), CheckedForICEInit(false), HasSideEffects(false),
901+
CheckedForSideEffects(false) {}
898902
};
899903

900904
/// Represents a variable declaration or definition.
@@ -1353,9 +1357,11 @@ class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
13531357
return const_cast<VarDecl *>(this)->getInitializingDeclaration();
13541358
}
13551359

1356-
/// Checks whether this declaration has an initializer with side effects,
1357-
/// without triggering deserialization if the initializer is not yet
1358-
/// deserialized.
1360+
/// Checks whether this declaration has an initializer with side effects.
1361+
/// The result is cached. If the result hasn't been computed this can trigger
1362+
/// deserialization and constant evaluation. By running this during
1363+
/// serialization and serializing the result all clients can safely call this
1364+
/// without triggering further deserialization.
13591365
bool hasInitWithSideEffects() const;
13601366

13611367
/// Determine whether this variable's value might be usable in a

clang/include/clang/AST/ExternalASTSource.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,6 @@ class ExternalASTSource : public RefCountedBase<ExternalASTSource> {
196196
/// module.
197197
virtual bool wasThisDeclarationADefinition(const FunctionDecl *FD);
198198

199-
virtual bool hasInitializerWithSideEffects(const VarDecl *VD) const {
200-
return false;
201-
}
202-
203199
/// Finds all declarations lexically contained within the given
204200
/// DeclContext, after applying an optional filter predicate.
205201
///
@@ -434,17 +430,6 @@ struct LazyOffsetPtr {
434430
return GetPtr();
435431
}
436432

437-
/// Retrieve the pointer to the AST node that this lazy pointer points to,
438-
/// if it can be done without triggering deserialization.
439-
///
440-
/// \returns a pointer to the AST node, or null if not yet deserialized.
441-
T *getWithoutDeserializing() const {
442-
if (isOffset()) {
443-
return nullptr;
444-
}
445-
return GetPtr();
446-
}
447-
448433
/// Retrieve the address of the AST node pointer. Deserializes the pointee if
449434
/// necessary.
450435
T **getAddressOfPointer(ExternalASTSource *Source) const {

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,11 @@ TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_f16_f32, "V2hV2hfUiIb", "nc", "f32-to-f16
645645
// GFX1250+ only builtins.
646646
//===----------------------------------------------------------------------===//
647647

648+
TARGET_BUILTIN(__builtin_amdgcn_tensor_load_to_lds, "vV4iV8iV4iV4iIi", "nc", "gfx1250-insts")
649+
TARGET_BUILTIN(__builtin_amdgcn_tensor_load_to_lds_d2, "vV4iV8iIi", "nc", "gfx1250-insts")
650+
TARGET_BUILTIN(__builtin_amdgcn_tensor_store_from_lds, "vV4iV8iV4iV4iIi", "nc", "gfx1250-insts")
651+
TARGET_BUILTIN(__builtin_amdgcn_tensor_store_from_lds_d2, "vV4iV8iIi", "nc", "gfx1250-insts")
652+
648653
TARGET_BUILTIN(__builtin_amdgcn_global_load_tr4_b64_v2i32, "V2iV2i*1", "nc", "transpose-load-f4f6-insts,wavefrontsize32")
649654
TARGET_BUILTIN(__builtin_amdgcn_global_load_tr8_b64_v2i32, "V2iV2i*1", "nc", "gfx1250-insts,wavefrontsize32")
650655
TARGET_BUILTIN(__builtin_amdgcn_global_load_tr6_b96_v3i32, "V3iV3i*1", "nc", "transpose-load-f4f6-insts,wavefrontsize32")

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3332,6 +3332,9 @@ def err_sve_vector_in_non_sve_target : Error<
33323332
"SVE vector type %0 cannot be used in a target without sve">;
33333333
def err_sve_vector_in_non_streaming_function : Error<
33343334
"SVE vector type %0 cannot be used in a non-streaming function">;
3335+
def err_sve_fixed_vector_in_streaming_function
3336+
: Error<"fixed width SVE vector type %0 cannot be used in a "
3337+
"%select{streaming|streaming-compatible}1 function">;
33353338
def err_attribute_riscv_rvv_bits_unsupported : Error<
33363339
"%0 is only supported when '-mrvv-vector-bits=<bits>' is specified with a "
33373340
"value of \"zvl\" or a power 2 in the range [64,65536]">;

clang/include/clang/Basic/LangOptions.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,9 @@ LANGOPT(OmitVTableRTTI, 1, 0,
518518
LANGOPT(VScaleMin, 32, 0, "Minimum vscale value")
519519
LANGOPT(VScaleMax, 32, 0, "Maximum vscale value")
520520

521+
LANGOPT(VScaleStreamingMin, 32, 0, "Minimum streaming vscale value")
522+
LANGOPT(VScaleStreamingMax, 32, 0, "Maximum streaming vscale value")
523+
521524
ENUM_LANGOPT(ExtendIntArgs, ExtendArgsKind, 1, ExtendArgsKind::ExtendTo32,
522525
"Controls how scalar integer arguments are extended in calls "
523526
"to unprototyped and varargs functions")

clang/include/clang/Basic/TargetInfo.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,9 +1034,15 @@ class TargetInfo : public TransferrableTargetInfo,
10341034
/// set of primary and secondary targets.
10351035
virtual llvm::SmallVector<Builtin::InfosShard> getTargetBuiltins() const = 0;
10361036

1037+
enum class ArmStreamingKind {
1038+
NotStreaming,
1039+
StreamingCompatible,
1040+
Streaming,
1041+
};
1042+
10371043
/// Returns target-specific min and max values VScale_Range.
10381044
virtual std::optional<std::pair<unsigned, unsigned>>
1039-
getVScaleRange(const LangOptions &LangOpts, bool IsArmStreamingFunction,
1045+
getVScaleRange(const LangOptions &LangOpts, ArmStreamingKind Mode,
10401046
llvm::StringMap<bool> *FeatureMap = nullptr) const {
10411047
return std::nullopt;
10421048
}

clang/include/clang/Driver/Options.td

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5356,6 +5356,14 @@ def msve_vector_bits_EQ : Joined<["-"], "msve-vector-bits=">, Group<m_aarch64_Fe
53565356
Visibility<[ClangOption, FlangOption]>,
53575357
HelpText<"Specify the size in bits of an SVE vector register. Defaults to the"
53585358
" vector length agnostic value of \"scalable\". (AArch64 only)">;
5359+
def msve_streaming_vector_bits_EQ
5360+
: Joined<["-"], "msve-streaming-vector-bits=">,
5361+
Group<m_aarch64_Features_Group>,
5362+
Visibility<[ClangOption, FlangOption]>,
5363+
HelpText<
5364+
"Specify the size in bits of an SVE vector register in streaming "
5365+
"mode. Defaults to the vector length agnostic value of "
5366+
"\"scalable\". (AArch64 only)">;
53595367
} // let Flags = [TargetSpecific]
53605368

53615369
def mvscale_min_EQ : Joined<["-"], "mvscale-min=">,
@@ -5367,6 +5375,17 @@ def mvscale_max_EQ : Joined<["-"], "mvscale-max=">,
53675375
HelpText<"Specify the vscale maximum. Defaults to the"
53685376
" vector length agnostic value of \"0\". (AArch64/RISC-V only)">,
53695377
MarshallingInfoInt<LangOpts<"VScaleMax">>;
5378+
def mvscale_streaming_min_EQ
5379+
: Joined<["-"], "mvscale-streaming-min=">,
5380+
Visibility<[CC1Option, FC1Option]>,
5381+
HelpText<"Specify the vscale minimum. Defaults to \"1\". (AArch64 only)">,
5382+
MarshallingInfoInt<LangOpts<"VScaleStreamingMin">>;
5383+
def mvscale_streaming_max_EQ
5384+
: Joined<["-"], "mvscale-streaming-max=">,
5385+
Visibility<[CC1Option, FC1Option]>,
5386+
HelpText<"Specify the vscale maximum. Defaults to the"
5387+
" vector length agnostic value of \"0\". (AArch64 only)">,
5388+
MarshallingInfoInt<LangOpts<"VScaleStreamingMax">>;
53705389

53715390
def msign_return_address_EQ : Joined<["-"], "msign-return-address=">,
53725391
Visibility<[ClangOption, CC1Option]>,

0 commit comments

Comments
 (0)