Skip to content

Commit dd2f072

Browse files
committed
Merge llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967. PR: 276104 MFC after: 1 month
2 parents 024a010 + 4fdf604 commit dd2f072

File tree

345 files changed

+4521
-1278
lines changed

Some content is hidden

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

345 files changed

+4521
-1278
lines changed

contrib/llvm-project/clang/include/clang/AST/Type.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3495,6 +3495,9 @@ enum class VectorKind {
34953495

34963496
/// is RISC-V RVV fixed-length data vector
34973497
RVVFixedLengthData,
3498+
3499+
/// is RISC-V RVV fixed-length mask vector
3500+
RVVFixedLengthMask,
34983501
};
34993502

35003503
/// Represents a GCC generic vector type. This type is created using

contrib/llvm-project/clang/include/clang/Basic/AttrDocs.td

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2424,7 +2424,10 @@ only be a power of 2 between 64 and 65536.
24242424
For types where LMUL!=1, ``__riscv_v_fixed_vlen`` needs to be scaled by the LMUL
24252425
of the type before passing to the attribute.
24262426

2427-
``vbool*_t`` types are not supported at this time.
2427+
For ``vbool*_t`` types, ``__riscv_v_fixed_vlen`` needs to be divided by the
2428+
number from the type name. For example, ``vbool8_t`` needs to use
2429+
``__riscv_v_fixed_vlen`` / 8. If the resulting value is not a multiple of 8,
2430+
the type is not supported for that value of ``__riscv_v_fixed_vlen``.
24282431
}];
24292432
}
24302433

contrib/llvm-project/clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,5 +436,67 @@ TARGET_BUILTIN(__builtin_amdgcn_global_load_tr_i32, "ii*1", "nc", "gfx12-insts,w
436436
TARGET_BUILTIN(__builtin_amdgcn_global_load_tr_v4i16, "V4sV4s*1", "nc", "gfx12-insts,wavefrontsize64")
437437
TARGET_BUILTIN(__builtin_amdgcn_global_load_tr_v4f16, "V4hV4h*1", "nc", "gfx12-insts,wavefrontsize64")
438438

439+
//===----------------------------------------------------------------------===//
440+
// WMMA builtins.
441+
// Postfix w32 indicates the builtin requires wavefront size of 32.
442+
// Postfix w64 indicates the builtin requires wavefront size of 64.
443+
//
444+
// Some of these are very similar to their GFX11 counterparts, but they don't
445+
// require replication of the A,B matrices, so they use fewer vector elements.
446+
// Therefore, we add an "_gfx12" suffix to distinguish them from the existing
447+
// builtins.
448+
//===----------------------------------------------------------------------===//
449+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_f16_w32_gfx12, "V8fV8hV8hV8f", "nc", "gfx12-insts,wavefrontsize32")
450+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf16_w32_gfx12, "V8fV8sV8sV8f", "nc", "gfx12-insts,wavefrontsize32")
451+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f16_16x16x16_f16_w32_gfx12, "V8hV8hV8hV8h", "nc", "gfx12-insts,wavefrontsize32")
452+
TARGET_BUILTIN(__builtin_amdgcn_wmma_bf16_16x16x16_bf16_w32_gfx12, "V8sV8sV8sV8s", "nc", "gfx12-insts,wavefrontsize32")
453+
TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu8_w32_gfx12, "V8iIbV2iIbV2iV8iIb", "nc", "gfx12-insts,wavefrontsize32")
454+
TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu4_w32_gfx12, "V8iIbiIbiV8iIb", "nc", "gfx12-insts,wavefrontsize32")
455+
// These are gfx12-only, but for consistency with the other WMMA variants we're
456+
// keeping the "_gfx12" suffix.
457+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_fp8_fp8_w32_gfx12, "V8fV2iV2iV8f", "nc", "gfx12-insts,wavefrontsize32")
458+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_fp8_bf8_w32_gfx12, "V8fV2iV2iV8f", "nc", "gfx12-insts,wavefrontsize32")
459+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf8_fp8_w32_gfx12, "V8fV2iV2iV8f", "nc", "gfx12-insts,wavefrontsize32")
460+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf8_bf8_w32_gfx12, "V8fV2iV2iV8f", "nc", "gfx12-insts,wavefrontsize32")
461+
TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x32_iu4_w32_gfx12, "V8iIbV2iIbV2iV8iIb", "nc", "gfx12-insts,wavefrontsize32")
462+
463+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_f16_w64_gfx12, "V4fV4hV4hV4f", "nc", "gfx12-insts,wavefrontsize64")
464+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf16_w64_gfx12, "V4fV4sV4sV4f", "nc", "gfx12-insts,wavefrontsize64")
465+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f16_16x16x16_f16_w64_gfx12, "V4hV4hV4hV4h", "nc", "gfx12-insts,wavefrontsize64")
466+
TARGET_BUILTIN(__builtin_amdgcn_wmma_bf16_16x16x16_bf16_w64_gfx12, "V4sV4sV4sV4s", "nc", "gfx12-insts,wavefrontsize64")
467+
TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu8_w64_gfx12, "V4iIbiIbiV4iIb", "nc", "gfx12-insts,wavefrontsize64")
468+
TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu4_w64_gfx12, "V4iIbiIbiV4iIb", "nc", "gfx12-insts,wavefrontsize64")
469+
// These are gfx12-only, but for consistency with the other WMMA variants we're
470+
// keeping the "_gfx12" suffix.
471+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_fp8_fp8_w64_gfx12, "V4fiiV4f", "nc", "gfx12-insts,wavefrontsize64")
472+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_fp8_bf8_w64_gfx12, "V4fiiV4f", "nc", "gfx12-insts,wavefrontsize64")
473+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf8_fp8_w64_gfx12, "V4fiiV4f", "nc", "gfx12-insts,wavefrontsize64")
474+
TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf8_bf8_w64_gfx12, "V4fiiV4f", "nc", "gfx12-insts,wavefrontsize64")
475+
TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x32_iu4_w64_gfx12, "V4iIbiIbiV4iIb", "nc", "gfx12-insts,wavefrontsize64")
476+
477+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_f16_w32, "V8fV8hV16hV8fs", "nc", "gfx12-insts,wavefrontsize32")
478+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_bf16_w32, "V8fV8sV16sV8fs", "nc", "gfx12-insts,wavefrontsize32")
479+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f16_16x16x32_f16_w32, "V8hV8hV16hV8hs", "nc", "gfx12-insts,wavefrontsize32")
480+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_bf16_16x16x32_bf16_w32, "V8sV8sV16sV8ss", "nc", "gfx12-insts,wavefrontsize32")
481+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x32_iu8_w32, "V8iIbV2iIbV4iV8isIb", "nc", "gfx12-insts,wavefrontsize32")
482+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x32_iu4_w32, "V8iIbiIbV2iV8isIb", "nc", "gfx12-insts,wavefrontsize32")
483+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x64_iu4_w32, "V8iIbV2iIbV4iV8isIb", "nc", "gfx12-insts,wavefrontsize32")
484+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_fp8_fp8_w32, "V8fV2iV4iV8fs", "nc", "gfx12-insts,wavefrontsize32")
485+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_fp8_bf8_w32, "V8fV2iV4iV8fs", "nc", "gfx12-insts,wavefrontsize32")
486+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_bf8_fp8_w32, "V8fV2iV4iV8fs", "nc", "gfx12-insts,wavefrontsize32")
487+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_bf8_bf8_w32, "V8fV2iV4iV8fs", "nc", "gfx12-insts,wavefrontsize32")
488+
489+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_f16_w64, "V4fV4hV8hV4fs", "nc", "gfx12-insts,wavefrontsize64")
490+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_bf16_w64, "V4fV4sV8sV4fs", "nc", "gfx12-insts,wavefrontsize64")
491+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f16_16x16x32_f16_w64, "V4hV4hV8hV4hs", "nc", "gfx12-insts,wavefrontsize64")
492+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_bf16_16x16x32_bf16_w64, "V4sV4sV8sV4ss", "nc", "gfx12-insts,wavefrontsize64")
493+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x32_iu8_w64, "V4iIbiIbV2iV4isIb", "nc", "gfx12-insts,wavefrontsize64")
494+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x32_iu4_w64, "V4iIbiIbiV4isIb", "nc", "gfx12-insts,wavefrontsize64")
495+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x64_iu4_w64, "V4iIbiIbV2iV4isIb", "nc", "gfx12-insts,wavefrontsize64")
496+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_fp8_fp8_w64, "V4fiV2iV4fs", "nc", "gfx12-insts,wavefrontsize64")
497+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_fp8_bf8_w64, "V4fiV2iV4fs", "nc", "gfx12-insts,wavefrontsize64")
498+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_bf8_fp8_w64, "V4fiV2iV4fs", "nc", "gfx12-insts,wavefrontsize64")
499+
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_bf8_bf8_w64, "V4fiV2iV4fs", "nc", "gfx12-insts,wavefrontsize64")
500+
439501
#undef BUILTIN
440502
#undef TARGET_BUILTIN

contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ ENUM_CODEGENOPT(VecLib, llvm::driver::VectorLibrary, 3, llvm::driver::VectorLibr
369369
/// The default TLS model to use.
370370
ENUM_CODEGENOPT(DefaultTLSModel, TLSModel, 2, GeneralDynamicTLSModel)
371371

372+
/// Whether to enable TLSDESC. AArch64 enables TLSDESC regardless of this value.
373+
CODEGENOPT(EnableTLSDESC, 1, 0)
374+
372375
/// Bit size of immediate TLS offsets (0 == use the default).
373376
VALUE_CODEGENOPT(TLSSize, 8, 0)
374377

contrib/llvm-project/clang/include/clang/Basic/DiagnosticCommonKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def warn_pragma_debug_unexpected_argument : Warning<
7373
def warn_fp_nan_inf_when_disabled : Warning<
7474
"use of %select{infinity|NaN}0%select{| via a macro}1 is undefined behavior "
7575
"due to the currently enabled floating-point options">,
76-
InGroup<DiagGroup<"nan-infinity-disabled">>;
76+
InGroup<DiagGroup<"nan-infinity-disabled", [], NanInfDisabledDocs>>;
7777
}
7878

7979
// Parse && Sema

contrib/llvm-project/clang/include/clang/Basic/DiagnosticDocs.td

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,12 @@ program by treating all string literals as having type ``const char *``
8787
instead of ``char *``. This can cause unexpected behaviors with type-sensitive
8888
constructs like ``_Generic``.
8989
}];
90+
91+
defvar NanInfDisabledDocs = [{
92+
This warning is enabled when source code using the macros ``INFINITY`` or ``NAN``
93+
is compiled with floating-point options preventing these two values. This can
94+
lead to undefined behavior. Check the order of command line arguments that modify
95+
this behavior, such as ``-ffast-math``, ``-fhonor-infinities``, and
96+
``-fhonor-nans`` (etc), as well as ``#pragma`` directives if this diagnostic is
97+
generated unexpectedly.
98+
}];

contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3711,6 +3711,12 @@ def err_sme_za_call_no_za_state : Error<
37113711
"call to a shared ZA function requires the caller to have ZA state">;
37123712
def err_sme_zt0_call_no_zt0_state : Error<
37133713
"call to a shared ZT0 function requires the caller to have ZT0 state">;
3714+
def err_sme_unimplemented_za_save_restore : Error<
3715+
"call to a function that shares state other than 'za' from a "
3716+
"function that has live 'za' state requires a spill/fill of ZA, which is not yet "
3717+
"implemented">;
3718+
def note_sme_use_preserves_za : Note<
3719+
"add '__arm_preserves(\"za\")' to the callee if it preserves ZA">;
37143720
def err_sme_definition_using_sm_in_non_sme_target : Error<
37153721
"function executed in streaming-SVE mode requires 'sme'">;
37163722
def err_sme_definition_using_za_in_non_sme_target : Error<

contrib/llvm-project/clang/include/clang/Basic/LangOptions.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ LANGOPT(MathErrno , 1, 1, "errno in math functions")
174174
BENIGN_LANGOPT(HeinousExtensions , 1, 0, "extensions that we really don't like and may be ripped out at any time")
175175
LANGOPT(Modules , 1, 0, "modules semantics")
176176
COMPATIBLE_LANGOPT(CPlusPlusModules, 1, 0, "C++ modules syntax")
177+
LANGOPT(SkipODRCheckInGMF, 1, 0, "Skip ODR checks for decls in the global module fragment")
177178
LANGOPT(BuiltinHeadersInSystemModules, 1, 0, "builtin headers belong to system modules, and _Builtin_ modules are ignored for cstdlib headers")
178179
BENIGN_ENUM_LANGOPT(CompilingModule, CompilingModuleKind, 3, CMK_None,
179180
"compiling a module interface")

contrib/llvm-project/clang/include/clang/Driver/Options.td

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,6 +2985,14 @@ def fmodule_output : Flag<["-"], "fmodule-output">, Flags<[NoXarchOption]>,
29852985
Visibility<[ClangOption, CC1Option]>,
29862986
HelpText<"Save intermediate module file results when compiling a standard C++ module unit.">;
29872987

2988+
defm skip_odr_check_in_gmf : BoolOption<"f", "skip-odr-check-in-gmf",
2989+
LangOpts<"SkipODRCheckInGMF">, DefaultFalse,
2990+
PosFlag<SetTrue, [], [CC1Option],
2991+
"Skip ODR checks for decls in the global module fragment.">,
2992+
NegFlag<SetFalse, [], [CC1Option],
2993+
"Perform ODR checks for decls in the global module fragment.">>,
2994+
Group<f_Group>;
2995+
29882996
def fmodules_prune_interval : Joined<["-"], "fmodules-prune-interval=">, Group<i_Group>,
29892997
Visibility<[ClangOption, CC1Option]>, MetaVarName<"<seconds>">,
29902998
HelpText<"Specify the interval (in seconds) between attempts to prune the module cache">,
@@ -4419,6 +4427,8 @@ def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group<m_Group>,
44194427
HelpText<"Specify bit size of immediate TLS offsets (AArch64 ELF only): "
44204428
"12 (for 4KB) | 24 (for 16MB, default) | 32 (for 4GB) | 48 (for 256TB, needs -mcmodel=large)">,
44214429
MarshallingInfoInt<CodeGenOpts<"TLSSize">>;
4430+
def mtls_dialect_EQ : Joined<["-"], "mtls-dialect=">, Group<m_Group>,
4431+
Flags<[TargetSpecific]>, HelpText<"Which thread-local storage dialect to use for dynamic accesses of TLS variables">;
44224432
def mimplicit_it_EQ : Joined<["-"], "mimplicit-it=">, Group<m_Group>;
44234433
def mdefault_build_attributes : Joined<["-"], "mdefault-build-attributes">, Group<m_Group>;
44244434
def mno_default_build_attributes : Joined<["-"], "mno-default-build-attributes">, Group<m_Group>;
@@ -7066,6 +7076,9 @@ def fexperimental_assignment_tracking_EQ : Joined<["-"], "fexperimental-assignme
70667076
Values<"disabled,enabled,forced">, NormalizedValues<["Disabled","Enabled","Forced"]>,
70677077
MarshallingInfoEnum<CodeGenOpts<"AssignmentTrackingMode">, "Enabled">;
70687078

7079+
def enable_tlsdesc : Flag<["-"], "enable-tlsdesc">,
7080+
MarshallingInfoFlag<CodeGenOpts<"EnableTLSDESC">>;
7081+
70697082
} // let Visibility = [CC1Option]
70707083

70717084
//===----------------------------------------------------------------------===//

contrib/llvm-project/clang/include/clang/Format/Format.h

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4157,14 +4157,9 @@ struct FormatStyle {
41574157

41584158
/// Different ways to put a space before opening parentheses.
41594159
enum SpaceBeforeParensStyle : int8_t {
4160-
/// Never put a space before opening parentheses.
4161-
/// \code
4162-
/// void f() {
4163-
/// if(true) {
4164-
/// f();
4165-
/// }
4166-
/// }
4167-
/// \endcode
4160+
/// This is **deprecated** and replaced by ``Custom`` below, with all
4161+
/// ``SpaceBeforeParensOptions`` but ``AfterPlacementOperator`` set to
4162+
/// ``false``.
41684163
SBPO_Never,
41694164
/// Put a space before opening parentheses only after control statement
41704165
/// keywords (``for/if/while...``).
@@ -4273,28 +4268,14 @@ struct FormatStyle {
42734268
/// object.operator++ (10); object.operator++(10);
42744269
/// \endcode
42754270
bool AfterOverloadedOperator;
4276-
/// Styles for adding spacing between ``new/delete`` operators and opening
4277-
/// parentheses.
4278-
enum AfterPlacementOperatorStyle : int8_t {
4279-
/// Remove space after ``new/delete`` operators and before ``(``.
4280-
/// \code
4281-
/// new(buf) T;
4282-
/// delete(buf) T;
4283-
/// \endcode
4284-
APO_Never,
4285-
/// Always add space after ``new/delete`` operators and before ``(``.
4286-
/// \code
4287-
/// new (buf) T;
4288-
/// delete (buf) T;
4289-
/// \endcode
4290-
APO_Always,
4291-
/// Leave placement ``new/delete`` expressions as they are.
4292-
APO_Leave,
4293-
};
4294-
/// Defines in which cases to put a space between ``new/delete`` operators
4295-
/// and opening parentheses.
4296-
/// \version 18
4297-
AfterPlacementOperatorStyle AfterPlacementOperator;
4271+
/// If ``true``, put a space between operator ``new``/``delete`` and opening
4272+
/// parenthesis.
4273+
/// \code
4274+
/// true: false:
4275+
/// new (buf) T; vs. new(buf) T;
4276+
/// delete (buf) T; delete(buf) T;
4277+
/// \endcode
4278+
bool AfterPlacementOperator;
42984279
/// If ``true``, put space between requires keyword in a requires clause and
42994280
/// opening parentheses, if there is one.
43004281
/// \code
@@ -4327,7 +4308,7 @@ struct FormatStyle {
43274308
: AfterControlStatements(false), AfterForeachMacros(false),
43284309
AfterFunctionDeclarationName(false),
43294310
AfterFunctionDefinitionName(false), AfterIfMacros(false),
4330-
AfterOverloadedOperator(false), AfterPlacementOperator(APO_Leave),
4311+
AfterOverloadedOperator(false), AfterPlacementOperator(true),
43314312
AfterRequiresInClause(false), AfterRequiresInExpression(false),
43324313
BeforeNonEmptyParentheses(false) {}
43334314

0 commit comments

Comments
 (0)