Skip to content

Commit 3ec88aa

Browse files
committed
merge main into amd-staging
2 parents 9ed0abf + 599d353 commit 3ec88aa

File tree

230 files changed

+2489
-1554
lines changed

Some content is hidden

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

230 files changed

+2489
-1554
lines changed

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 47 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -276,21 +276,25 @@ let Features = "sse2", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] i
276276
def psllw128 : X86Builtin<"_Vector<8, short>(_Vector<8, short>, _Vector<8, short>)">;
277277
def pslld128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Vector<4, int>)">;
278278
def psllq128 : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Vector<2, long long int>)">;
279+
def pmaddwd128 : X86Builtin<"_Vector<4, int>(_Vector<8, short>, _Vector<8, short>)">;
280+
def pslldqi128_byteshift : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Constant int)">;
281+
def psrldqi128_byteshift : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Constant int)">;
282+
}
283+
284+
let Features = "sse2",
285+
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
286+
def pmuludq128 : X86Builtin<"_Vector<2, long long int>(_Vector<4, int>, _Vector<4, int>)">;
287+
279288
def psllwi128 : X86Builtin<"_Vector<8, short>(_Vector<8, short>, int)">;
280289
def pslldi128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, int)">;
281290
def psllqi128 : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, int)">;
291+
282292
def psrlwi128 : X86Builtin<"_Vector<8, short>(_Vector<8, short>, int)">;
283293
def psrldi128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, int)">;
284294
def psrlqi128 : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, int)">;
295+
285296
def psrawi128 : X86Builtin<"_Vector<8, short>(_Vector<8, short>, int)">;
286297
def psradi128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, int)">;
287-
def pmaddwd128 : X86Builtin<"_Vector<4, int>(_Vector<8, short>, _Vector<8, short>)">;
288-
def pslldqi128_byteshift : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Constant int)">;
289-
def psrldqi128_byteshift : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Constant int)">;
290-
}
291-
292-
let Features = "sse2", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
293-
def pmuludq128 : X86Builtin<"_Vector<2, long long int>(_Vector<4, int>, _Vector<4, int>)">;
294298
}
295299

296300
let Features = "sse3", Attributes = [NoThrow] in {
@@ -595,23 +599,15 @@ let Features = "avx2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] i
595599
def psignb256 : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>)">;
596600
def psignw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<16, short>)">;
597601
def psignd256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Vector<8, int>)">;
598-
def psllwi256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, int)">;
599602
def psllw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<8, short>)">;
600603
def pslldqi256_byteshift : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Constant int)">;
601-
def pslldi256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, int)">;
602604
def pslld256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Vector<4, int>)">;
603-
def psllqi256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, int)">;
604605
def psllq256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Vector<2, long long int>)">;
605-
def psrawi256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, int)">;
606606
def psraw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<8, short>)">;
607-
def psradi256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, int)">;
608607
def psrad256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Vector<4, int>)">;
609608
def psrldqi256_byteshift : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Constant int)">;
610-
def psrlwi256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, int)">;
611609
def psrlw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<8, short>)">;
612-
def psrldi256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, int)">;
613610
def psrld256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Vector<4, int>)">;
614-
def psrlqi256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, int)">;
615611
def psrlq256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Vector<2, long long int>)">;
616612
def pblendd128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Vector<4, int>, _Constant int)">;
617613
def pblendd256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Vector<8, int>, _Constant int)">;
@@ -628,6 +624,19 @@ let Features = "avx2", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWi
628624
def pmuldq256 : X86Builtin<"_Vector<4, long long int>(_Vector<8, int>, _Vector<8, int>)">;
629625
def pmuludq256 : X86Builtin<"_Vector<4, long long int>(_Vector<8, int>, _Vector<8, int>)">;
630626

627+
def psllwi256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, int)">;
628+
def pslldi256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, int)">;
629+
def psllqi256
630+
: X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, int)">;
631+
632+
def psrlwi256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, int)">;
633+
def psrldi256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, int)">;
634+
def psrlqi256
635+
: X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, int)">;
636+
637+
def psrawi256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, int)">;
638+
def psradi256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, int)">;
639+
631640
def pmulhuw256 : X86Builtin<"_Vector<16, unsigned short>(_Vector<16, unsigned short>, _Vector<16, unsigned short>)">;
632641
def pmulhw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<16, short>)">;
633642

@@ -2038,43 +2047,22 @@ let Features = "avx512dq,evex512", Attributes = [NoThrow, Const, RequiredVectorW
20382047

20392048
let Features = "avx512f,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
20402049
def prold512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, _Constant int)">;
2041-
def prolq512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, _Constant int)">;
2042-
}
2043-
2044-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
2045-
def prold128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Constant int)">;
2046-
}
2047-
2048-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
2049-
def prold256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Constant int)">;
2050-
}
2051-
2052-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
2053-
def prolq128 : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Constant int)">;
2054-
}
2055-
2056-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
2057-
def prolq256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Constant int)">;
2058-
}
2059-
2060-
let Features = "avx512f,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
20612050
def prord512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, _Constant int)">;
2051+
def prolq512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, _Constant int)">;
20622052
def prorq512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, _Constant int)">;
20632053
}
20642054

20652055
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
2056+
def prold128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Constant int)">;
20662057
def prord128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Constant int)">;
2067-
}
2068-
2069-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
2070-
def prord256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Constant int)">;
2071-
}
2072-
2073-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
2058+
def prolq128 : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Constant int)">;
20742059
def prorq128 : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, _Constant int)">;
20752060
}
20762061

20772062
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
2063+
def prold256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Constant int)">;
2064+
def prord256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Constant int)">;
2065+
def prolq256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Constant int)">;
20782066
def prorq256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Constant int)">;
20792067
}
20802068

@@ -2083,7 +2071,6 @@ let Features = "avx512bw,evex512", Attributes = [NoThrow, Const, RequiredVectorW
20832071
def pshuflw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Constant int)">;
20842072
def psllv32hi : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Vector<32, short>)">;
20852073
def psllw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Vector<8, short>)">;
2086-
def psllwi512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, int)">;
20872074
}
20882075

20892076
let Features = "avx512bw,avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
@@ -2094,7 +2081,9 @@ let Features = "avx512bw,avx512vl", Attributes = [NoThrow, Const, RequiredVector
20942081
def psllv8hi : X86Builtin<"_Vector<8, short>(_Vector<8, short>, _Vector<8, short>)">;
20952082
}
20962083

2097-
let Features = "avx512f,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
2084+
let Features = "avx512f,evex512",
2085+
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
2086+
def psllwi512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, int)">;
20982087
def pslldi512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, int)">;
20992088
def psllqi512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, int)">;
21002089
}
@@ -2111,7 +2100,9 @@ let Features = "avx512bw,avx512vl", Attributes = [NoThrow, Const, RequiredVector
21112100
def psrlv8hi : X86Builtin<"_Vector<8, short>(_Vector<8, short>, _Vector<8, short>)">;
21122101
}
21132102

2114-
let Features = "avx512f,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
2103+
let Features = "avx512f,evex512",
2104+
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
2105+
def psrlwi512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, int)">;
21152106
def psrldi512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, int)">;
21162107
def psrlqi512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, int)">;
21172108
}
@@ -2137,10 +2128,10 @@ let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256
21372128
}
21382129

21392130
let Features = "avx512bw,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
2140-
def psraw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Vector<8, short>)">;
2141-
def psrawi512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, int)">;
2142-
def psrlw512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Vector<8, short>)">;
2143-
def psrlwi512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, int)">;
2131+
def psraw512
2132+
: X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Vector<8, short>)">;
2133+
def psrlw512
2134+
: X86Builtin<"_Vector<32, short>(_Vector<32, short>, _Vector<8, short>)">;
21442135
def pslldqi512_byteshift : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, _Constant int)">;
21452136
def psrldqi512_byteshift : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, _Constant int)">;
21462137
}
@@ -2456,7 +2447,9 @@ let Features = "avx512f", Attributes = [NoThrow, Const, RequiredVectorWidth<128>
24562447
def scalefss_round_mask : X86Builtin<"_Vector<4, float>(_Vector<4, float>, _Vector<4, float>, _Vector<4, float>, unsigned char, _Constant int)">;
24572448
}
24582449

2459-
let Features = "avx512f,evex512", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
2450+
let Features = "avx512f,evex512",
2451+
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
2452+
def psrawi512 : X86Builtin<"_Vector<32, short>(_Vector<32, short>, int)">;
24602453
def psradi512 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, int)">;
24612454
def psraqi512 : X86Builtin<"_Vector<8, long long int>(_Vector<8, long long int>, int)">;
24622455
}
@@ -2469,11 +2462,13 @@ let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256
24692462
def psraq256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Vector<2, long long int>)">;
24702463
}
24712464

2472-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
2465+
let Features = "avx512vl",
2466+
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
24732467
def psraqi128 : X86Builtin<"_Vector<2, long long int>(_Vector<2, long long int>, int)">;
24742468
}
24752469

2476-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
2470+
let Features = "avx512vl",
2471+
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256>] in {
24772472
def psraqi256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, int)">;
24782473
}
24792474

clang/include/clang/Basic/LangOptions.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ LANGOPT(HLSL, 1, 0, NotCompatible, "HLSL")
256256
ENUM_LANGOPT(HLSLVersion, HLSLLangStd, 16, HLSL_Unset, NotCompatible, "HLSL Version")
257257
LANGOPT(HLSLStrictAvailability, 1, 0, NotCompatible,
258258
"Strict availability diagnostic mode for HLSL built-in functions.")
259+
LANGOPT(HLSLSpvUseUnknownImageFormat, 1, 0, NotCompatible, "For storage images and texel buffers, sets the default format to 'Unknown' when not specified via the `vk::image_format` attribute. If this option is not used, the format is inferred from the resource's data type.")
259260

260261
LANGOPT(CUDAIsDevice , 1, 0, NotCompatible, "compiling for CUDA device")
261262
LANGOPT(CUDAAllowVariadicFunctions, 1, 0, NotCompatible, "allowing variadic functions in CUDA device code")

clang/include/clang/Driver/Options.td

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9802,6 +9802,16 @@ def fvk_use_scalar_layout
98029802
: DXCFlag<"fvk-use-scalar-layout">,
98039803
HelpText<"Use scalar memory layout for Vulkan resources.">;
98049804

9805+
def fhlsl_spv_use_unknown_image_format
9806+
: Flag<["-"], "fspv-use-unknown-image-format">,
9807+
Group<dxc_Group>,
9808+
Visibility<[CC1Option, DXCOption]>,
9809+
HelpText<"For storage images and texel buffers, sets the default format "
9810+
"to 'Unknown' when not specified via the `vk::image_format` "
9811+
"attribute. If this option is not used, the format is inferred "
9812+
"from the resource's data type.">,
9813+
MarshallingInfoFlag<LangOpts<"HLSLSpvUseUnknownImageFormat">>;
9814+
98059815
def no_wasm_opt : Flag<["--"], "no-wasm-opt">,
98069816
Group<m_Group>,
98079817
HelpText<"Disable the wasm-opt optimizer">,

clang/lib/AST/ASTImporter.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,21 +1740,10 @@ ExpectedType ASTNodeImporter::VisitDeducedTemplateSpecializationType(
17401740
}
17411741

17421742
ExpectedType ASTNodeImporter::VisitTagType(const TagType *T) {
1743-
TagDecl *DeclForType = T->getOriginalDecl();
1744-
Expected<TagDecl *> ToDeclOrErr = import(DeclForType);
1743+
Expected<TagDecl *> ToDeclOrErr = import(T->getOriginalDecl());
17451744
if (!ToDeclOrErr)
17461745
return ToDeclOrErr.takeError();
17471746

1748-
if (DeclForType->isUsed()) {
1749-
// If there is a definition of the 'OriginalDecl', it should be imported to
1750-
// have all information for the type in the "To" AST. (In some cases no
1751-
// other reference may exist to the definition decl and it would not be
1752-
// imported otherwise.)
1753-
Expected<TagDecl *> ToDefDeclOrErr = import(DeclForType->getDefinition());
1754-
if (!ToDefDeclOrErr)
1755-
return ToDefDeclOrErr.takeError();
1756-
}
1757-
17581747
if (T->isCanonicalUnqualified())
17591748
return Importer.getToContext().getCanonicalTagType(*ToDeclOrErr);
17601749

clang/lib/AST/ByteCode/Interp.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3490,7 +3490,15 @@ inline bool AllocN(InterpState &S, CodePtr OpPC, PrimType T, const Expr *Source,
34903490
S.Stk.push<Pointer>(0, nullptr);
34913491
return true;
34923492
}
3493-
assert(NumElements.isPositive());
3493+
if (NumElements.isNegative()) {
3494+
if (!IsNoThrow) {
3495+
S.FFDiag(S.Current->getSource(OpPC), diag::note_constexpr_new_negative)
3496+
<< NumElements.toDiagnosticString(S.getASTContext());
3497+
return false;
3498+
}
3499+
S.Stk.push<Pointer>(0, nullptr);
3500+
return true;
3501+
}
34943502

34953503
if (!CheckArraySize(S, OpPC, static_cast<uint64_t>(NumElements)))
34963504
return false;

0 commit comments

Comments
 (0)