Skip to content

Commit 4034377

Browse files
authored
Merge branch 'main' into patch-1
2 parents 8ca3af4 + bc55f4f commit 4034377

File tree

121 files changed

+1524
-616
lines changed

Some content is hidden

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

121 files changed

+1524
-616
lines changed

.ci/generate_test_report_github.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import generate_test_report_lib
1010

11+
1112
def compute_platform_title() -> str:
1213
logo = ":window:" if platform.system() == "Windows" else ":penguin:"
1314
# On Linux the machine value is x86_64 on Windows it is AMD64.

.ci/generate_test_report_lib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def _format_ninja_failures(ninja_failures: list[tuple[str, str]]) -> list[str]:
100100
)
101101
return output
102102

103+
103104
def get_failures(junit_objects) -> dict[str, list[tuple[str, str]]]:
104105
failures = {}
105106
for results in junit_objects:

bolt/test/runtime/AArch64/inline-memcpy.s

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@
8181
# CHECK-ASM: bl{{.*}}<memcpy
8282

8383
# Register move should NOT be inlined (size unknown at compile time)
84-
# CHECK-ASM-LABEL: <test_register_move_negative>:
84+
# CHECK-ASM-LABEL: <test_register_move_unknown>:
8585
# CHECK-ASM: bl{{.*}}<memcpy
8686

87-
# CHECK-ASM-LABEL: <test_x2_rewrite_negative>:
87+
# CHECK-ASM-LABEL: <test_x2_rewrite_unknown>:
8888
# CHECK-ASM: bl{{.*}}<memcpy
8989

9090
# Live-in parameter should NOT be inlined (size unknown at compile time)
91-
# CHECK-ASM-LABEL: <test_live_in_negative>:
91+
# CHECK-ASM-LABEL: <test_live_in_unknown>:
9292
# CHECK-ASM: bl{{.*}}<memcpy
9393

9494
# _memcpy8 should be inlined with end-pointer return (dest+size)
@@ -262,9 +262,9 @@ test_4_byte_add_immediate:
262262
ret
263263
.size test_4_byte_add_immediate, .-test_4_byte_add_immediate
264264

265-
.globl test_register_move_negative
266-
.type test_register_move_negative,@function
267-
test_register_move_negative:
265+
.globl test_register_move_unknown
266+
.type test_register_move_unknown,@function
267+
test_register_move_unknown:
268268
stp x29, x30, [sp, #-32]!
269269
mov x29, sp
270270
add x1, sp, #16
@@ -274,20 +274,20 @@ test_register_move_negative:
274274
bl memcpy
275275
ldp x29, x30, [sp], #32
276276
ret
277-
.size test_register_move_negative, .-test_register_move_negative
277+
.size test_register_move_unknown, .-test_register_move_unknown
278278

279-
.globl test_x2_rewrite_negative
280-
.type test_x2_rewrite_negative,@function
281-
test_x2_rewrite_negative:
279+
.globl test_x2_rewrite_unknown
280+
.type test_x2_rewrite_unknown,@function
281+
test_x2_rewrite_unknown:
282282
mov x2, #8
283283
ldr x2, [sp, #24]
284284
bl memcpy
285285
ret
286-
.size test_x2_rewrite_negative, .-test_x2_rewrite_negative
286+
.size test_x2_rewrite_unknown, .-test_x2_rewrite_unknown
287287

288-
.globl test_live_in_negative
289-
.type test_live_in_negative,@function
290-
test_live_in_negative:
288+
.globl test_live_in_unknown
289+
.type test_live_in_unknown,@function
290+
test_live_in_unknown:
291291
# x2 comes in as parameter, no instruction sets it (should NOT inline)
292292
stp x29, x30, [sp, #-32]!
293293
mov x29, sp
@@ -297,7 +297,7 @@ test_live_in_negative:
297297
bl memcpy
298298
ldp x29, x30, [sp], #32
299299
ret
300-
.size test_live_in_negative, .-test_live_in_negative
300+
.size test_live_in_unknown, .-test_live_in_unknown
301301

302302
.globl test_memcpy8_4_byte
303303
.type test_memcpy8_4_byte,@function

clang/include/clang/Basic/AttrDocs.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3450,9 +3450,9 @@ Mac, and BSD. This attribute has no effect on other targets.
34503450
def MSABIDocs : Documentation {
34513451
let Category = DocCatCallingConvs;
34523452
let Content = [{
3453-
On non-Windows x86_64 targets, this attribute changes the calling convention of
3454-
a function to match the default convention used on Windows x86_64. This
3455-
attribute has no effect on Windows targets or non-x86_64 targets.
3453+
On non-Windows x86_64 and aarch64 targets, this attribute changes the calling convention of
3454+
a function to match the default convention used on Windows. This
3455+
attribute has no effect on Windows targets or non-x86_64, non-aarch64 targets.
34563456
}];
34573457
}
34583458

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ BUILTIN(__builtin_amdgcn_raw_buffer_load_b128, "V4UiQbiiIi", "n")
180180
BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_add_i32, "iiQbiiIi", "")
181181

182182
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fadd_f32, "ffQbiiIi", "", "atomic-fadd-rtn-insts")
183-
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16, "V2hV2hQbiiIi", "t", "atomic-buffer-global-pk-add-f16-insts")
183+
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16, "V2hV2hQbiiIi", "", "atomic-buffer-global-pk-add-f16-insts")
184184

185185
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmin_f32, "ffQbiiIi", "", "atomic-fmin-fmax-global-f32")
186186
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_atomic_fmax_f32, "ffQbiiIi", "", "atomic-fmin-fmax-global-f32")

clang/include/clang/Basic/IdentifierTable.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,57 @@ class LangOptions;
4646
class MultiKeywordSelector;
4747
class SourceLocation;
4848

49+
/// Constants for TokenKinds.def
50+
enum TokenKey : unsigned {
51+
KEYC99 = 0x1,
52+
KEYCXX = 0x2,
53+
KEYCXX11 = 0x4,
54+
KEYGNU = 0x8,
55+
KEYMS = 0x10,
56+
BOOLSUPPORT = 0x20,
57+
KEYALTIVEC = 0x40,
58+
KEYNOCXX = 0x80,
59+
KEYBORLAND = 0x100,
60+
KEYOPENCLC = 0x200,
61+
KEYC23 = 0x400,
62+
KEYNOMS18 = 0x800,
63+
KEYNOOPENCL = 0x1000,
64+
WCHARSUPPORT = 0x2000,
65+
HALFSUPPORT = 0x4000,
66+
CHAR8SUPPORT = 0x8000,
67+
KEYOBJC = 0x10000,
68+
KEYZVECTOR = 0x20000,
69+
KEYCOROUTINES = 0x40000,
70+
KEYMODULES = 0x80000,
71+
KEYCXX20 = 0x100000,
72+
KEYOPENCLCXX = 0x200000,
73+
KEYMSCOMPAT = 0x400000,
74+
KEYSYCL = 0x800000,
75+
KEYCUDA = 0x1000000,
76+
KEYZOS = 0x2000000,
77+
KEYNOZOS = 0x4000000,
78+
KEYHLSL = 0x8000000,
79+
KEYFIXEDPOINT = 0x10000000,
80+
KEYMAX = KEYFIXEDPOINT, // The maximum key
81+
KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20,
82+
KEYALL = (KEYMAX | (KEYMAX - 1)) & ~KEYNOMS18 & ~KEYNOOPENCL &
83+
~KEYNOZOS // KEYNOMS18, KEYNOOPENCL, KEYNOZOS are excluded.
84+
};
85+
86+
/// How a keyword is treated in the selected standard. This enum is ordered
87+
/// intentionally so that the value that 'wins' is the most 'permissive'.
88+
enum KeywordStatus {
89+
KS_Unknown, // Not yet calculated. Used when figuring out the status.
90+
KS_Disabled, // Disabled
91+
KS_Future, // Is a keyword in future standard
92+
KS_Extension, // Is an extension
93+
KS_Enabled, // Enabled
94+
};
95+
96+
/// Translates flags as specified in TokenKinds.def into keyword status
97+
/// in the given language standard.
98+
KeywordStatus getKeywordStatus(const LangOptions &LangOpts, unsigned Flags);
99+
49100
enum class ReservedIdentifierStatus {
50101
NotReserved = 0,
51102
StartsWithUnderscoreAtGlobalScope,

clang/lib/Basic/IdentifierTable.cpp

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -77,57 +77,6 @@ IdentifierTable::IdentifierTable(const LangOptions &LangOpts,
7777
// Language Keyword Implementation
7878
//===----------------------------------------------------------------------===//
7979

80-
// Constants for TokenKinds.def
81-
namespace {
82-
83-
enum TokenKey : unsigned {
84-
KEYC99 = 0x1,
85-
KEYCXX = 0x2,
86-
KEYCXX11 = 0x4,
87-
KEYGNU = 0x8,
88-
KEYMS = 0x10,
89-
BOOLSUPPORT = 0x20,
90-
KEYALTIVEC = 0x40,
91-
KEYNOCXX = 0x80,
92-
KEYBORLAND = 0x100,
93-
KEYOPENCLC = 0x200,
94-
KEYC23 = 0x400,
95-
KEYNOMS18 = 0x800,
96-
KEYNOOPENCL = 0x1000,
97-
WCHARSUPPORT = 0x2000,
98-
HALFSUPPORT = 0x4000,
99-
CHAR8SUPPORT = 0x8000,
100-
KEYOBJC = 0x10000,
101-
KEYZVECTOR = 0x20000,
102-
KEYCOROUTINES = 0x40000,
103-
KEYMODULES = 0x80000,
104-
KEYCXX20 = 0x100000,
105-
KEYOPENCLCXX = 0x200000,
106-
KEYMSCOMPAT = 0x400000,
107-
KEYSYCL = 0x800000,
108-
KEYCUDA = 0x1000000,
109-
KEYZOS = 0x2000000,
110-
KEYNOZOS = 0x4000000,
111-
KEYHLSL = 0x8000000,
112-
KEYFIXEDPOINT = 0x10000000,
113-
KEYMAX = KEYFIXEDPOINT, // The maximum key
114-
KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20,
115-
KEYALL = (KEYMAX | (KEYMAX - 1)) & ~KEYNOMS18 & ~KEYNOOPENCL &
116-
~KEYNOZOS // KEYNOMS18, KEYNOOPENCL, KEYNOZOS are excluded.
117-
};
118-
119-
/// How a keyword is treated in the selected standard. This enum is ordered
120-
/// intentionally so that the value that 'wins' is the most 'permissive'.
121-
enum KeywordStatus {
122-
KS_Unknown, // Not yet calculated. Used when figuring out the status.
123-
KS_Disabled, // Disabled
124-
KS_Future, // Is a keyword in future standard
125-
KS_Extension, // Is an extension
126-
KS_Enabled, // Enabled
127-
};
128-
129-
} // namespace
130-
13180
// This works on a single TokenKey flag and checks the LangOpts to get the
13281
// KeywordStatus based exclusively on this flag, so that it can be merged in
13382
// getKeywordStatus. Most should be enabled/disabled, but some might imply
@@ -220,9 +169,7 @@ static KeywordStatus getKeywordStatusHelper(const LangOptions &LangOpts,
220169
}
221170
}
222171

223-
/// Translates flags as specified in TokenKinds.def into keyword status
224-
/// in the given language standard.
225-
static KeywordStatus getKeywordStatus(const LangOptions &LangOpts,
172+
KeywordStatus clang::getKeywordStatus(const LangOptions &LangOpts,
226173
unsigned Flags) {
227174
// KEYALL means always enabled, so special case this one.
228175
if (Flags == KEYALL) return KS_Enabled;

clang/lib/Sema/SemaFunctionEffects.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,14 @@ class Analyzer {
13021302
return true;
13031303
}
13041304

1305+
bool TraverseCXXRecordDecl(CXXRecordDecl *D) override {
1306+
// Completely skip local struct/class/union declarations since their
1307+
// methods would otherwise be incorrectly interpreted as part of the
1308+
// function we are currently traversing. The initial Sema pass will have
1309+
// already recorded any nonblocking methods needing analysis.
1310+
return true;
1311+
}
1312+
13051313
bool TraverseConstructorInitializer(CXXCtorInitializer *Init) override {
13061314
ViolationSite PrevVS = VSite;
13071315
if (Init->isAnyMemberInitializer())

clang/test/Sema/attr-nonblocking-constraints.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@ void nb8c()
104104
};
105105
}
106106

107+
void nb8d() [[clang::nonblocking]]
108+
{
109+
// Blocking methods of a local CXXRecordDecl do not generate diagnostics
110+
// for the outer function.
111+
struct F1 {
112+
void method() { void* ptr = new int; }
113+
};
114+
115+
// Skipping the CXXRecordDecl does not skip a following VarDecl.
116+
struct F2 {
117+
F2() { void* ptr = new int; } // expected-note {{constructor cannot be inferred 'nonblocking' because it allocates or deallocates memory}}
118+
} f2; // expected-warning {{function with 'nonblocking' attribute must not call non-'nonblocking' constructor 'nb8d()::F2::F2'}}
119+
120+
// Nonblocking methods of a local CXXRecordDecl are verified independently.
121+
struct F3 {
122+
void method() [[clang::nonblocking]] { void* ptr = new int; }// expected-warning {{function with 'nonblocking' attribute must not allocate or deallocate memory}}
123+
};
124+
}
125+
107126
// Make sure template expansions are found and verified.
108127
template <typename T>
109128
struct Adder {

clang/test/SemaHIP/builtins-amdgcn-raw-buffer-atomic-add.hip

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ __device__ void test_raw_ptr_atomics(__amdgpu_buffer_rsrc_t rsrc, int i32, float
1414
__device__ void test_raw_ptr_atomics_err(__amdgpu_buffer_rsrc_t rsrc, int i32, float f32, float16x2_t v2f16, int offset, int soffset) {
1515
i32 = __builtin_amdgcn_raw_ptr_buffer_atomic_add_i32(i32, rsrc, offset, soffset, 0, 4); // expected-error{{too many arguments to function call}}
1616
f32 = __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_f32(f32, rsrc, offset, soffset, 0, 4); // expected-error{{too many arguments to function call}}
17-
v2f16 = __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16(v2f16, rsrc, offset, soffset, 0, 4);
17+
v2f16 = __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16(v2f16, rsrc, offset, soffset, 0, 4); // expected-error{{too many arguments to function call}}
18+
}
19+
20+
__device__ void test_raw_ptr_atomics_f16_retty(__amdgpu_buffer_rsrc_t rsrc, int i32, float f32, float16x2_t v2f16, int offset, int soffset) {
21+
v2f16 = __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16(v2f16, rsrc, offset, soffset, 0);
1822
}

0 commit comments

Comments
 (0)