Skip to content

Commit 99b8c73

Browse files
Merge branch 'llvm:main' into cleanup-duplicated-includes
2 parents cfd54a8 + 610e33a commit 99b8c73

File tree

365 files changed

+19186
-7116
lines changed

Some content is hidden

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

365 files changed

+19186
-7116
lines changed

.ci/metrics/metrics.py

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -130,34 +130,6 @@ def get_per_workflow_metrics(
130130
workflow_jobs = workflow_run.jobs()
131131
if workflow_jobs.totalCount == 0:
132132
continue
133-
if workflow_jobs.totalCount > 1:
134-
raise ValueError(
135-
f"Encountered an unexpected number of jobs: {workflow_jobs.totalCount}"
136-
)
137-
138-
created_at = workflow_jobs[0].created_at
139-
started_at = workflow_jobs[0].started_at
140-
completed_at = workflow_jobs[0].completed_at
141-
142-
job_result = int(workflow_jobs[0].conclusion == "success")
143-
if job_result:
144-
# We still might want to mark the job as a failure if one of the steps
145-
# failed. This is required due to use setting continue-on-error in
146-
# the premerge pipeline to prevent sending emails while we are
147-
# testing the infrastructure.
148-
# TODO(boomanaiden154): Remove this once the premerge pipeline is no
149-
# longer in a testing state and we can directly assert the workflow
150-
# result.
151-
for step in workflow_jobs[0].steps:
152-
if step.conclusion != "success":
153-
job_result = 0
154-
break
155-
156-
queue_time = started_at - created_at
157-
run_time = completed_at - started_at
158-
159-
if run_time.seconds == 0:
160-
continue
161133

162134
if (
163135
workflows_to_track[workflow_run.name] is None
@@ -170,20 +142,45 @@ def get_per_workflow_metrics(
170142
):
171143
break
172144

173-
# The timestamp associated with the event is expected by Grafana to be
174-
# in nanoseconds.
175-
created_at_ns = int(created_at.timestamp()) * 10**9
176-
177-
workflow_metrics.append(
178-
JobMetrics(
179-
workflow_run.name,
180-
queue_time.seconds,
181-
run_time.seconds,
182-
job_result,
183-
created_at_ns,
184-
workflow_run.id,
145+
for workflow_job in workflow_jobs:
146+
created_at = workflow_job.created_at
147+
started_at = workflow_job.started_at
148+
completed_at = workflow_job.completed_at
149+
150+
job_result = int(workflow_job.conclusion == "success")
151+
if job_result:
152+
# We still might want to mark the job as a failure if one of the steps
153+
# failed. This is required due to use setting continue-on-error in
154+
# the premerge pipeline to prevent sending emails while we are
155+
# testing the infrastructure.
156+
# TODO(boomanaiden154): Remove this once the premerge pipeline is no
157+
# longer in a testing state and we can directly assert the workflow
158+
# result.
159+
for step in workflow_job.steps:
160+
if step.conclusion != "success":
161+
job_result = 0
162+
break
163+
164+
queue_time = started_at - created_at
165+
run_time = completed_at - started_at
166+
167+
if run_time.seconds == 0:
168+
continue
169+
170+
# The timestamp associated with the event is expected by Grafana to be
171+
# in nanoseconds.
172+
created_at_ns = int(created_at.timestamp()) * 10**9
173+
174+
workflow_metrics.append(
175+
JobMetrics(
176+
workflow_run.name + "-" + workflow_job.name,
177+
queue_time.seconds,
178+
run_time.seconds,
179+
job_result,
180+
created_at_ns,
181+
workflow_run.id,
182+
)
185183
)
186-
)
187184

188185
return workflow_metrics
189186

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ C Language Changes
387387
------------------
388388

389389
- Extend clang's ``<limits.h>`` to define ``LONG_LONG_*`` macros for Android's bionic.
390+
- Macro ``__STDC_NO_THREADS__`` is no longer necessary for MSVC 2022 1939 and later.
390391

391392
C2y Feature Support
392393
^^^^^^^^^^^^^^^^^^^
@@ -1002,6 +1003,9 @@ Bug Fixes to C++ Support
10021003
- Fixed assertions or false compiler diagnostics in the case of C++ modules for
10031004
lambda functions or inline friend functions defined inside templates (#GH122493).
10041005
- Clang now rejects declaring an alias template with the same name as its template parameter. (#GH123423)
1006+
- Fixed immediate escalation of non-dependent expressions. (#GH123405)
1007+
- Fix type of expression when calling a template which returns an ``__array_rank`` querying a type depending on a
1008+
template parameter. Now, such expression can be used with ``static_assert`` and ``constexpr``. (#GH123498)
10051009
- Correctly determine the implicit constexprness of lambdas in dependent contexts. (#GH97958) (#GH114234)
10061010

10071011
Bug Fixes to AST Handling

clang/include/clang/AST/ExprCXX.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2847,8 +2847,8 @@ class TypeTraitExpr final
28472847
///
28482848
/// Example:
28492849
/// \code
2850-
/// __array_rank(int[10][20]) == 2
2851-
/// __array_extent(int, 1) == 20
2850+
/// __array_rank(int[10][20]) == 2
2851+
/// __array_extent(int[10][20], 1) == 20
28522852
/// \endcode
28532853
class ArrayTypeTraitExpr : public Expr {
28542854
/// The trait. An ArrayTypeTrait enum in MSVC compat unsigned.
@@ -4326,8 +4326,6 @@ class SizeOfPackExpr final
43264326
/// Retrieve the parameter pack.
43274327
NamedDecl *getPack() const { return Pack; }
43284328

4329-
void setPack(NamedDecl *NewPack) { Pack = NewPack; }
4330-
43314329
/// Retrieve the length of the parameter pack.
43324330
///
43334331
/// This routine may only be invoked when the expression is not

clang/include/clang/AST/Type.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
25182518
bool isFloat32Type() const;
25192519
bool isDoubleType() const;
25202520
bool isBFloat16Type() const;
2521+
bool isMFloat8Type() const;
25212522
bool isFloat128Type() const;
25222523
bool isIbm128Type() const;
25232524
bool isRealType() const; // C99 6.2.5p17 (real floating + integer)
@@ -8537,6 +8538,10 @@ inline bool Type::isBFloat16Type() const {
85378538
return isSpecificBuiltinType(BuiltinType::BFloat16);
85388539
}
85398540

8541+
inline bool Type::isMFloat8Type() const {
8542+
return isSpecificBuiltinType(BuiltinType::MFloat8);
8543+
}
8544+
85408545
inline bool Type::isFloat128Type() const {
85418546
return isSpecificBuiltinType(BuiltinType::Float128);
85428547
}

clang/include/clang/Basic/AArch64SVEACLETypes.def

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
// - IsBF true for vector of brain float elements.
5858
//===----------------------------------------------------------------------===//
5959

60+
#ifndef SVE_SCALAR_TYPE
61+
#define SVE_SCALAR_TYPE(Name, MangledName, Id, SingletonId, Bits) \
62+
SVE_TYPE(Name, Id, SingletonId)
63+
#endif
64+
6065
#ifndef SVE_VECTOR_TYPE
6166
#define SVE_VECTOR_TYPE(Name, MangledName, Id, SingletonId) \
6267
SVE_TYPE(Name, Id, SingletonId)
@@ -72,6 +77,11 @@
7277
SVE_VECTOR_TYPE_DETAILS(Name, MangledName, Id, SingletonId, NumEls, ElBits, NF, false, false, true)
7378
#endif
7479

80+
#ifndef SVE_VECTOR_TYPE_MFLOAT
81+
#define SVE_VECTOR_TYPE_MFLOAT(Name, MangledName, Id, SingletonId, NumEls, ElBits, NF) \
82+
SVE_VECTOR_TYPE_DETAILS(Name, MangledName, Id, SingletonId, NumEls, ElBits, NF, false, false, false)
83+
#endif
84+
7585
#ifndef SVE_VECTOR_TYPE_FLOAT
7686
#define SVE_VECTOR_TYPE_FLOAT(Name, MangledName, Id, SingletonId, NumEls, ElBits, NF) \
7787
SVE_VECTOR_TYPE_DETAILS(Name, MangledName, Id, SingletonId, NumEls, ElBits, NF, false, true, false)
@@ -97,16 +107,6 @@
97107
SVE_TYPE(Name, Id, SingletonId)
98108
#endif
99109

100-
#ifndef AARCH64_VECTOR_TYPE
101-
#define AARCH64_VECTOR_TYPE(Name, MangledName, Id, SingletonId) \
102-
SVE_TYPE(Name, Id, SingletonId)
103-
#endif
104-
105-
#ifndef AARCH64_VECTOR_TYPE_MFLOAT
106-
#define AARCH64_VECTOR_TYPE_MFLOAT(Name, MangledName, Id, SingletonId, NumEls, ElBits, NF) \
107-
AARCH64_VECTOR_TYPE(Name, MangledName, Id, SingletonId)
108-
#endif
109-
110110
//===- Vector point types -----------------------------------------------===//
111111

112112
SVE_VECTOR_TYPE_INT("__SVInt8_t", "__SVInt8_t", SveInt8, SveInt8Ty, 16, 8, 1, true)
@@ -125,8 +125,7 @@ SVE_VECTOR_TYPE_FLOAT("__SVFloat64_t", "__SVFloat64_t", SveFloat64, SveFloat64Ty
125125

126126
SVE_VECTOR_TYPE_BFLOAT("__SVBfloat16_t", "__SVBfloat16_t", SveBFloat16, SveBFloat16Ty, 8, 16, 1)
127127

128-
// This is a 8 bits opaque type.
129-
SVE_VECTOR_TYPE_INT("__SVMfloat8_t", "__SVMfloat8_t", SveMFloat8, SveMFloat8Ty, 16, 8, 1, false)
128+
SVE_VECTOR_TYPE_MFLOAT("__SVMfloat8_t", "__SVMfloat8_t", SveMFloat8, SveMFloat8Ty, 16, 8, 1)
130129

131130
//
132131
// x2
@@ -148,7 +147,7 @@ SVE_VECTOR_TYPE_FLOAT("__clang_svfloat64x2_t", "svfloat64x2_t", SveFloat64x2, Sv
148147

149148
SVE_VECTOR_TYPE_BFLOAT("__clang_svbfloat16x2_t", "svbfloat16x2_t", SveBFloat16x2, SveBFloat16x2Ty, 8, 16, 2)
150149

151-
SVE_VECTOR_TYPE_INT("__clang_svmfloat8x2_t", "svmfloat8x2_t", SveMFloat8x2, SveMFloat8x2Ty, 16, 8, 2, false)
150+
SVE_VECTOR_TYPE_MFLOAT("__clang_svmfloat8x2_t", "svmfloat8x2_t", SveMFloat8x2, SveMFloat8x2Ty, 16, 8, 2)
152151

153152
//
154153
// x3
@@ -170,7 +169,7 @@ SVE_VECTOR_TYPE_FLOAT("__clang_svfloat64x3_t", "svfloat64x3_t", SveFloat64x3, Sv
170169

171170
SVE_VECTOR_TYPE_BFLOAT("__clang_svbfloat16x3_t", "svbfloat16x3_t", SveBFloat16x3, SveBFloat16x3Ty, 8, 16, 3)
172171

173-
SVE_VECTOR_TYPE_INT("__clang_svmfloat8x3_t", "svmfloat8x3_t", SveMFloat8x3, SveMFloat8x3Ty, 16, 8, 3, false)
172+
SVE_VECTOR_TYPE_MFLOAT("__clang_svmfloat8x3_t", "svmfloat8x3_t", SveMFloat8x3, SveMFloat8x3Ty, 16, 8, 3)
174173

175174
//
176175
// x4
@@ -192,25 +191,23 @@ SVE_VECTOR_TYPE_FLOAT("__clang_svfloat64x4_t", "svfloat64x4_t", SveFloat64x4, Sv
192191

193192
SVE_VECTOR_TYPE_BFLOAT("__clang_svbfloat16x4_t", "svbfloat16x4_t", SveBFloat16x4, SveBFloat16x4Ty, 8, 16, 4)
194193

195-
SVE_VECTOR_TYPE_INT("__clang_svmfloat8x4_t", "svmfloat8x4_t", SveMFloat8x4, SveMFloat8x4Ty, 16, 8, 4, false)
194+
SVE_VECTOR_TYPE_MFLOAT("__clang_svmfloat8x4_t", "svmfloat8x4_t", SveMFloat8x4, SveMFloat8x4Ty, 16, 8, 4)
196195

197196
SVE_PREDICATE_TYPE_ALL("__SVBool_t", "__SVBool_t", SveBool, SveBoolTy, 16, 1)
198197
SVE_PREDICATE_TYPE_ALL("__clang_svboolx2_t", "svboolx2_t", SveBoolx2, SveBoolx2Ty, 16, 2)
199198
SVE_PREDICATE_TYPE_ALL("__clang_svboolx4_t", "svboolx4_t", SveBoolx4, SveBoolx4Ty, 16, 4)
200199

201200
SVE_OPAQUE_TYPE("__SVCount_t", "__SVCount_t", SveCount, SveCountTy)
202201

203-
AARCH64_VECTOR_TYPE_MFLOAT("__mfp8", "__mfp8", MFloat8, MFloat8Ty, 1, 8, 1)
204-
AARCH64_VECTOR_TYPE_MFLOAT("__MFloat8x8_t", "__MFloat8x8_t", MFloat8x8, MFloat8x8Ty, 8, 8, 1)
205-
AARCH64_VECTOR_TYPE_MFLOAT("__MFloat8x16_t", "__MFloat8x16_t", MFloat8x16, MFloat8x16Ty, 16, 8, 1)
202+
SVE_SCALAR_TYPE("__mfp8", "__mfp8", MFloat8, MFloat8Ty, 8)
206203

207204
#undef SVE_VECTOR_TYPE
205+
#undef SVE_VECTOR_TYPE_MFLOAT
208206
#undef SVE_VECTOR_TYPE_BFLOAT
209207
#undef SVE_VECTOR_TYPE_FLOAT
210208
#undef SVE_VECTOR_TYPE_INT
211209
#undef SVE_PREDICATE_TYPE
212210
#undef SVE_PREDICATE_TYPE_ALL
213211
#undef SVE_OPAQUE_TYPE
214-
#undef AARCH64_VECTOR_TYPE_MFLOAT
215-
#undef AARCH64_VECTOR_TYPE
212+
#undef SVE_SCALAR_TYPE
216213
#undef SVE_TYPE

clang/include/clang/Basic/LangOptions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class LangOptionsBase {
144144
MSVC2019_5 = 1925,
145145
MSVC2019_8 = 1928,
146146
MSVC2022_3 = 1933,
147+
MSVC2022_9 = 1939,
147148
};
148149

149150
enum SYCLMajorVersion {

clang/include/clang/Basic/TargetBuiltins.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ namespace clang {
208208
Float16,
209209
Float32,
210210
Float64,
211-
BFloat16
211+
BFloat16,
212+
MFloat8
212213
};
213214

214215
NeonTypeFlags(unsigned F) : Flags(F) {}
@@ -230,6 +231,7 @@ namespace clang {
230231
switch (getEltType()) {
231232
case Int8:
232233
case Poly8:
234+
case MFloat8:
233235
return 8;
234236
case Int16:
235237
case Float16:

clang/include/clang/Basic/arm_neon.td

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,6 +2119,28 @@ let ArchGuard = "defined(__aarch64__)", TargetGuard = "lut" in {
21192119
}
21202120
}
21212121

2122+
let ArchGuard = "defined(__aarch64__)", TargetGuard = "fp8,neon" in {
2123+
def VBF1CVT_BF16_MF8 : VInst<"vcvt1_bf16_mf8_fpm", "(QB).V", "m">;
2124+
def VBF1CVT_LOW_BF16_MF8 : VInst<"vcvt1_low_bf16_mf8_fpm", "B.V", "Hm">;
2125+
def VBF2CVTL_BF16_MF8 : VInst<"vcvt2_bf16_mf8_fpm", "(QB).V", "m">;
2126+
def VBF2CVTL_LOW_BF16_MF8 : VInst<"vcvt2_low_bf16_mf8_fpm", "B.V", "Hm">;
2127+
def VBF1CVTL2_HIGH_BF16_MF8 : VInst<"vcvt1_high_bf16_mf8_fpm", "B.V", "Hm">;
2128+
def VBF2CVTL2_HIGH_BF16_MF8 : VInst<"vcvt2_high_bf16_mf8_fpm", "B.V", "Hm">;
2129+
}
2130+
2131+
let ArchGuard = "defined(__aarch64__)", TargetGuard = "fp8,neon" in {
2132+
def VF1CVT_F16_MF8 : VInst<"vcvt1_f16_mf8_fpm", "(>QF).V", "m">;
2133+
def VF1CVT_LOW_F16_MF8 : VInst<"vcvt1_low_f16_mf8_fpm", "(>F).V", "Hm">;
2134+
def VF2CVTL_F16_MF8 : VInst<"vcvt2_f16_mf8_fpm", "(>QF).V", "m">;
2135+
def VF2CVTL_LOW_F16_MF8 : VInst<"vcvt2_low_f16_mf8_fpm", "(>F).V", "Hm">;
2136+
def VF1CVTL2_HIGH_F16_MF8 : VInst<"vcvt1_high_f16_mf8_fpm", "(>F).V", "Hm">;
2137+
def VF2CVTL2_HIGH_F16_MF8 : VInst<"vcvt2_high_f16_mf8_fpm", "(>F).V", "Hm">;
2138+
2139+
def VCVTN_LOW_F8_F32 : VInst<"vcvt_mf8_f32_fpm", ".(>>QF)(>>QF)V", "m">;
2140+
def VCVTN_HIGH_F8_F32 : VInst<"vcvt_high_mf8_f32_fpm", ".(q)(>>F)(>>F)V", "Hm">;
2141+
def VCVTN_F8_F16 : VInst<"vcvt_mf8_f16_fpm", ".(>F)(>F)V", "mQm">;
2142+
}
2143+
21222144
let ArchGuard = "defined(__aarch64__)", TargetGuard = "neon,faminmax" in {
21232145
def FAMIN : WInst<"vamin", "...", "fhQdQfQh">;
21242146
def FAMAX : WInst<"vamax", "...", "fhQdQfQh">;

clang/include/clang/Basic/arm_neon_incl.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ def OP_UNAVAILABLE : Operation {
243243
// B: change to BFloat16
244244
// P: change to polynomial category.
245245
// p: change polynomial to equivalent integer category. Otherwise nop.
246+
// V: change to fpm_t
246247
//
247248
// >: double element width (vector size unchanged).
248249
// <: half element width (vector size unchanged).
@@ -301,6 +302,7 @@ class Inst <string n, string p, string t, Operation o, list<ImmCheck> ch = []>{
301302
class SInst<string n, string p, string t, list<ImmCheck> ch = []> : Inst<n, p, t, OP_NONE, ch> {}
302303
class IInst<string n, string p, string t, list<ImmCheck> ch = []> : Inst<n, p, t, OP_NONE, ch> {}
303304
class WInst<string n, string p, string t, list<ImmCheck> ch = []> : Inst<n, p, t, OP_NONE, ch> {}
305+
class VInst<string n, string p, string t> : Inst<n, p, t, OP_NONE> {}
304306

305307
// The following instruction classes are implemented via operators
306308
// instead of builtins. As such these declarations are only used for

clang/include/clang/Driver/Options.td

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6970,8 +6970,11 @@ defm unsigned : OptInFC1FFlag<"unsigned", "Enables UNSIGNED type">;
69706970
def fno_automatic : Flag<["-"], "fno-automatic">, Group<f_Group>,
69716971
HelpText<"Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE">;
69726972

6973-
def fsave_main_program : Flag<["-"], "fsave-main-program">, Group<f_Group>,
6974-
HelpText<"Place all variables from the main program in static memory (otherwise scalars may be placed on the stack)">;
6973+
defm save_main_program : BoolOptionWithoutMarshalling<"f", "save-main-program",
6974+
PosFlag<SetTrue, [], [],
6975+
"Place all main program variables in static memory (otherwise scalars may be placed on the stack)">,
6976+
NegFlag<SetFalse, [], [],
6977+
"Allow placing main program variables on the stack (default)">>;
69756978

69766979
defm stack_arrays : BoolOptionWithoutMarshalling<"f", "stack-arrays",
69776980
PosFlag<SetTrue, [], [ClangOption], "Attempt to allocate array temporaries on the stack, no matter their size">,

0 commit comments

Comments
 (0)