Skip to content

Commit 3d1476e

Browse files
committed
Merge branch 'main' into xegpu_simt_dist_prefetch_gpu_index
2 parents f4c3474 + b0bf48d commit 3d1476e

File tree

62 files changed

+2747
-824
lines changed

Some content is hidden

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

62 files changed

+2747
-824
lines changed

clang/include/clang/Lex/HLSLRootSignatureTokenKinds.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ PUNCTUATOR(minus, '-')
7575
// RootElement Keywords:
7676
KEYWORD(RootSignature) // used only for diagnostic messaging
7777
KEYWORD(DescriptorTable)
78+
KEYWORD(RootConstants)
79+
80+
// RootConstants Keywords:
81+
KEYWORD(num32BitConstants)
7882

7983
// DescriptorTable Keywords:
8084
KEYWORD(CBV)

clang/include/clang/Parse/ParseHLSLRootSignature.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class RootSignatureParser {
7171
// expected, or, there is a lexing error
7272

7373
/// Root Element parse methods:
74+
std::optional<llvm::hlsl::rootsig::RootConstants> parseRootConstants();
7475
std::optional<llvm::hlsl::rootsig::DescriptorTable> parseDescriptorTable();
7576
std::optional<llvm::hlsl::rootsig::DescriptorTableClause>
7677
parseDescriptorTableClause();

clang/lib/CodeGen/CGObjC.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2386,7 +2386,8 @@ static llvm::Value *emitOptimizedARCReturnCall(llvm::Value *value,
23862386
// FIXME: Do this on all targets and at -O0 too. This can be enabled only if
23872387
// the target backend knows how to handle the operand bundle.
23882388
if (CGF.CGM.getCodeGenOpts().OptimizationLevel > 0 &&
2389-
(Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::x86_64)) {
2389+
(Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::aarch64_32 ||
2390+
Arch == llvm::Triple::x86_64)) {
23902391
llvm::Value *bundleArgs[] = {EP};
23912392
llvm::OperandBundleDef OB("clang.arc.attachedcall", bundleArgs);
23922393
auto *oldCall = cast<llvm::CallBase>(value);

clang/lib/Driver/ToolChains/Arch/Mips.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,6 @@ void mips::getMIPSTargetFeatures(const Driver &D, const llvm::Triple &Triple,
255255
D.Diag(diag::err_drv_unsupported_noabicalls_pic);
256256
}
257257

258-
if (CPUName == "i6500" || CPUName == "i6400") {
259-
// MIPS cpu i6400 and i6500 support MSA (Mips SIMD Architecture)
260-
// by default.
261-
Features.push_back("+msa");
262-
}
263-
264258
if (!UseAbiCalls)
265259
Features.push_back("+noabicalls");
266260
else

clang/lib/Driver/ToolChains/Arch/X86.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ void x86::getX86TargetFeatures(const Driver &D, const llvm::Triple &Triple,
122122
// Claim and report unsupported -mabi=. Note: we don't support "sysv_abi" or
123123
// "ms_abi" as default function attributes.
124124
if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_mabi_EQ)) {
125-
StringRef DefaultAbi = Triple.isOSWindows() ? "ms" : "sysv";
125+
StringRef DefaultAbi =
126+
(Triple.isOSWindows() || Triple.isUEFI()) ? "ms" : "sysv";
126127
if (A->getValue() != DefaultAbi)
127128
D.Diag(diag::err_drv_unsupported_opt_for_target)
128129
<< A->getSpelling() << Triple.getTriple();

clang/lib/Lex/ModuleMap.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,10 @@ void ModuleMap::resolveHeader(Module *Mod,
310310
} else if (Header.HasBuiltinHeader && !Header.Size && !Header.ModTime) {
311311
// There's a builtin header but no corresponding on-disk header. Assume
312312
// this was supposed to modularize the builtin header alone.
313-
} else if (Header.Kind == Module::HK_Excluded) {
314-
// Ignore missing excluded header files. They're optional anyway.
313+
} else if ((Header.Kind == Module::HK_Excluded) ||
314+
(Header.Kind == Module::HK_Textual)) {
315+
// Ignore excluded and textual header files as a module can be built with
316+
// such headers missing.
315317
} else {
316318
// If we find a module that has a missing header, we mark this module as
317319
// unavailable and store the header directive for displaying diagnostics.

clang/lib/Parse/ParseHLSLRootSignature.cpp

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ RootSignatureParser::RootSignatureParser(SmallVector<RootElement> &Elements,
2727
bool RootSignatureParser::parse() {
2828
// Iterate as many RootElements as possible
2929
do {
30+
if (tryConsumeExpectedToken(TokenKind::kw_RootConstants)) {
31+
auto Constants = parseRootConstants();
32+
if (!Constants.has_value())
33+
return true;
34+
Elements.push_back(*Constants);
35+
}
36+
3037
if (tryConsumeExpectedToken(TokenKind::kw_DescriptorTable)) {
3138
auto Table = parseDescriptorTable();
3239
if (!Table.has_value())
@@ -35,12 +42,27 @@ bool RootSignatureParser::parse() {
3542
}
3643
} while (tryConsumeExpectedToken(TokenKind::pu_comma));
3744

38-
if (consumeExpectedToken(TokenKind::end_of_stream,
45+
return consumeExpectedToken(TokenKind::end_of_stream,
46+
diag::err_hlsl_unexpected_end_of_params,
47+
/*param of=*/TokenKind::kw_RootSignature);
48+
}
49+
50+
std::optional<RootConstants> RootSignatureParser::parseRootConstants() {
51+
assert(CurToken.TokKind == TokenKind::kw_RootConstants &&
52+
"Expects to only be invoked starting at given keyword");
53+
54+
if (consumeExpectedToken(TokenKind::pu_l_paren, diag::err_expected_after,
55+
CurToken.TokKind))
56+
return std::nullopt;
57+
58+
RootConstants Constants;
59+
60+
if (consumeExpectedToken(TokenKind::pu_r_paren,
3961
diag::err_hlsl_unexpected_end_of_params,
40-
/*param of=*/TokenKind::kw_RootSignature))
41-
return true;
62+
/*param of=*/TokenKind::kw_RootConstants))
63+
return std::nullopt;
4264

43-
return false;
65+
return Constants;
4466
}
4567

4668
std::optional<DescriptorTable> RootSignatureParser::parseDescriptorTable() {

clang/test/CodeGenObjCXX/arc-rv-attr.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// RUN: %clang_cc1 -triple arm64-apple-ios9 -fobjc-runtime=ios-9.0 -fobjc-arc -std=c++11 -O -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK
2+
// RUN: %clang_cc1 -triple arm64e-apple-ios15 -fobjc-runtime=ios-9.0 -fobjc-arc -std=c++11 -O -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK
3+
// RUN: %clang_cc1 -triple arm64_32-apple-watchos7 -fobjc-runtime=watchos-7.0 -fobjc-arc -std=c++11 -O -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK
24

35
id foo(void);
46

clang/test/Driver/mips-cpus.c

Lines changed: 0 additions & 9 deletions
This file was deleted.

clang/test/Driver/x86-mabi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: %clang -### --target=x86_64-windows-msvc -mabi=ms -S %s 2>&1 | FileCheck %s
2+
// RUN: %clang -### --target=x86_64-uefi -mabi=ms -S %s 2>&1 | FileCheck %s
23
// RUN: not %clang -### --target=i386-unknown-linux -mabi=ms -S %s 2>&1 | FileCheck --check-prefix=ERR %s
34
// RUN: not %clang -### --target=x86_64-windows-msvc -mabi=sysv -S %s 2>&1 | FileCheck --check-prefix=ERR %s
5+
// RUN: not %clang -### --target=x86_64-uefi -mabi=sysv -S %s 2>&1 | FileCheck --check-prefix=ERR %s
46
// RUN: %clang -### --target=i386-unknown-linux -mabi=sysv -S %s 2>&1 | FileCheck %s
57

68
// RUN: %clang -### --target=x86_64-windows-gnu -mabi=ms -S %s 2>&1 | FileCheck %s

0 commit comments

Comments
 (0)