Skip to content

Commit 3de1253

Browse files
committed
merge main into amd-staging
Change-Id: Iddfe6e91e9ef4c0105337015bedaa4e072143686
2 parents a40ca3a + 4d273b9 commit 3de1253

File tree

142 files changed

+2325
-901
lines changed

Some content is hidden

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

142 files changed

+2325
-901
lines changed

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ on:
2828
- 'polly/docs/**'
2929
- 'flang/docs/**'
3030
- 'flang/include/flang/Optimizer/Dialect/FIROps.td'
31+
- '.github/workflows/docs.yml'
3132
pull_request:
3233
paths:
3334
- 'llvm/docs/**'
@@ -45,6 +46,7 @@ on:
4546
- 'polly/docs/**'
4647
- 'flang/docs/**'
4748
- 'flang/include/flang/Optimizer/Dialect/FIROps.td'
49+
- '.github/workflows/docs.yml'
4850

4951
jobs:
5052
check-docs-build:
@@ -162,8 +164,6 @@ jobs:
162164
TZ=UTC ninja -C polly-build docs-polly-html docs-polly-man
163165
- name: Build Flang docs
164166
if: steps.docs-changed-subprojects.outputs.flang_any_changed == 'true'
165-
# TODO(boomanaiden154): Remove the SPHINX_WARNINGS_AS_ERRORS from the
166-
# CMake invocation once the warnings in the flang docs build are fixed.
167167
run: |
168-
cmake -B flang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;mlir;flang" -DLLVM_ENABLE_SPHINX=ON -DSPHINX_WARNINGS_AS_ERRORS=OFF ./llvm
169-
TZ=UTC ninja -C flang-build docs-flang-html docs-flang-man
168+
cmake -B flang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;mlir;flang" -DLLVM_ENABLE_SPHINX=ON ./llvm
169+
TZ=UTC ninja -C flang-build docs-flang-html

clang/docs/LanguageExtensions.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5274,6 +5274,11 @@ Intrinsics Support within Constant Expressions
52745274
52755275
The following builtin intrinsics can be used in constant expressions:
52765276
5277+
* ``__builtin_addcb``
5278+
* ``__builtin_addcs``
5279+
* ``__builtin_addc``
5280+
* ``__builtin_addcl``
5281+
* ``__builtin_addcll``
52775282
* ``__builtin_bitreverse8``
52785283
* ``__builtin_bitreverse16``
52795284
* ``__builtin_bitreverse32``
@@ -5320,6 +5325,11 @@ The following builtin intrinsics can be used in constant expressions:
53205325
* ``__builtin_rotateright16``
53215326
* ``__builtin_rotateright32``
53225327
* ``__builtin_rotateright64``
5328+
* ``__builtin_subcb``
5329+
* ``__builtin_subcs``
5330+
* ``__builtin_subc``
5331+
* ``__builtin_subcl``
5332+
* ``__builtin_subcll``
53235333
53245334
The following x86-specific intrinsics can be used in constant expressions:
53255335

clang/docs/ReleaseNotes.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,28 @@ C23 Feature Support
127127
- No longer diagnose use of binary literals as an extension in C23 mode. Fixes
128128
`#72017 <https://github.com/llvm/llvm-project/issues/72017>`_.
129129

130+
- Corrected parsing behavior for the ``alignas`` specifier/qualifier in C23. We
131+
previously handled it as an attribute as in C++, but there are parsing
132+
differences. The behavioral differences are:
133+
134+
.. code-block:: c
135+
136+
struct alignas(8) /* was accepted, now rejected */ S {
137+
char alignas(8) /* was rejected, now accepted */ C;
138+
};
139+
int i alignas(8) /* was accepted, now rejected */ ;
140+
141+
Fixes (`#81472 <https://github.com/llvm/llvm-project/issues/81472>`_).
142+
130143
Non-comprehensive list of changes in this release
131144
-------------------------------------------------
132145

133146
- Added ``__builtin_readsteadycounter`` for reading fixed frequency hardware
134147
counters.
135148

149+
- ``__builtin_addc``, ``__builtin_subc``, and the other sizes of those
150+
builtins are now constexpr and may be used in constant expressions.
151+
136152
New Compiler Flags
137153
------------------
138154

@@ -324,6 +340,8 @@ Fixed Point Support in Clang
324340
AST Matchers
325341
------------
326342

343+
- ``isInStdNamespace`` now supports Decl declared with ``extern "C++"``.
344+
327345
clang-format
328346
------------
329347

clang/include/clang/Basic/Builtins.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4067,14 +4067,14 @@ class MPATemplate : Template<
40674067

40684068
def Addc : Builtin, MPATemplate {
40694069
let Spellings = ["__builtin_addc"];
4070-
let Attributes = [NoThrow];
4070+
let Attributes = [NoThrow, Constexpr];
40714071
// FIXME: Why are these argumentes marked const?
40724072
let Prototype = "T(T const, T const, T const, T*)";
40734073
}
40744074

40754075
def Subc : Builtin, MPATemplate {
40764076
let Spellings = ["__builtin_subc"];
4077-
let Attributes = [NoThrow];
4077+
let Attributes = [NoThrow, Constexpr];
40784078
// FIXME: Why are these argumentes marked const?
40794079
let Prototype = "T(T const, T const, T const, T*)";
40804080
}

clang/include/clang/Basic/DiagnosticCommonKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@ def warn_target_unrecognized_env : Warning<
356356
def warn_knl_knm_isa_support_removed : Warning<
357357
"KNL, KNM related Intel Xeon Phi CPU's specific ISA's supports will be removed in LLVM 19.">,
358358
InGroup<DiagGroup<"knl-knm-isa-support-removed">>;
359+
def err_target_unsupported_abi_with_fpu : Error<
360+
"'%0' ABI is not supported with FPU">;
359361

360362
// Source manager
361363
def err_cannot_open_file : Error<"cannot open file '%0': %1">, DefaultFatal;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11312,6 +11312,8 @@ def err_omp_wrong_dependency_iterator_type : Error<
1131211312
def err_target_unsupported_type
1131311313
: Error<"%0 requires %select{|%2 bit size}1 %3 %select{|return }4type support,"
1131411314
" but target '%5' does not support it">;
11315+
def err_target_unsupported_type_for_abi
11316+
: Error<"%0 requires %1 type support, but ABI '%2' does not support it">;
1131511317
def err_omp_lambda_capture_in_declare_target_not_to : Error<
1131611318
"variable captured in declare target region must appear in a to clause">;
1131711319
def err_omp_device_type_mismatch : Error<

clang/include/clang/Basic/TargetInfo.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ class TargetInfo : public TransferrableTargetInfo,
231231
bool HasIbm128;
232232
bool HasLongDouble;
233233
bool HasFPReturn;
234+
bool HasFPTypes;
234235
bool HasStrictFP;
235236

236237
unsigned char MaxAtomicPromoteWidth, MaxAtomicInlineWidth;
@@ -689,6 +690,9 @@ class TargetInfo : public TransferrableTargetInfo,
689690
/// on this target.
690691
virtual bool hasFPReturn() const { return HasFPReturn; }
691692

693+
/// Determine whether floating point types are supported for this target.
694+
virtual bool hasFPTypes() const { return HasFPTypes; }
695+
692696
/// Determine whether constrained floating point is supported on this target.
693697
virtual bool hasStrictFP() const { return HasStrictFP; }
694698

@@ -1331,6 +1335,10 @@ class TargetInfo : public TransferrableTargetInfo,
13311335
return false;
13321336
}
13331337

1338+
/// Make changes to the supported types which depend on both the target
1339+
/// features and ABI.
1340+
virtual void setSupportedArgTypes() {}
1341+
13341342
/// Use the specified unit for FP math.
13351343
///
13361344
/// \return False on error (invalid unit name).

clang/include/clang/Driver/Options.td

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4743,11 +4743,15 @@ def menable_experimental_extensions : Flag<["-"], "menable-experimental-extensio
47434743
def mrvv_vector_bits_EQ : Joined<["-"], "mrvv-vector-bits=">, Group<m_Group>,
47444744
Visibility<[ClangOption, FlangOption]>,
47454745
HelpText<"Specify the size in bits of an RVV vector register">,
4746-
DocBrief<"Defaults to the vector length agnostic value of \"scalable\". "
4747-
"Accepts power of 2 values between 64 and 65536. Also accepts "
4748-
"\"zvl\" to use the value implied by -march/-mcpu. On Clang, value "
4749-
"will be reflected in __riscv_v_fixed_vlen preprocessor define "
4750-
"(RISC-V only)">;
4746+
DocBrief<!strconcat(
4747+
"Defaults to the vector length agnostic value of \"scalable\". "
4748+
"Accepts power of 2 values between 64 and 65536. Also accepts "
4749+
"\"zvl\" to use the value implied by -march/-mcpu.",
4750+
!cond(
4751+
// Flang does not set the preprocessor define.
4752+
!eq(GlobalDocumentation.Program, "Flang") : "",
4753+
true: " The value will be reflected in __riscv_v_fixed_vlen preprocessor define"),
4754+
" (RISC-V only)")>;
47514755

47524756
def munaligned_access : Flag<["-"], "munaligned-access">, Group<m_Group>,
47534757
HelpText<"Allow memory accesses to be unaligned (AArch32/AArch64/LoongArch/RISC-V only)">;

clang/include/clang/Parse/Parser.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3572,7 +3572,21 @@ class Parser : public CodeCompletionHandler {
35723572
StmtResult ParseOpenACCDirectiveStmt();
35733573

35743574
private:
3575-
void ParseOpenACCDirective();
3575+
/// A struct to hold the information that got parsed by ParseOpenACCDirective,
3576+
/// so that the callers of it can use that to construct the appropriate AST
3577+
/// nodes.
3578+
struct OpenACCDirectiveParseInfo {
3579+
OpenACCDirectiveKind DirKind;
3580+
SourceLocation StartLoc;
3581+
SourceLocation EndLoc;
3582+
// TODO OpenACC: Add Clause list here once we have a type for that.
3583+
// TODO OpenACC: As we implement support for the Atomic, Routine, Cache, and
3584+
// Wait constructs, we likely want to put that information in here as well.
3585+
};
3586+
3587+
/// Parses the OpenACC directive (the entire pragma) including the clause
3588+
/// list, but does not produce the main AST node.
3589+
OpenACCDirectiveParseInfo ParseOpenACCDirective();
35763590
/// Helper that parses an ID Expression based on the language options.
35773591
ExprResult ParseOpenACCIDExpression();
35783592
/// Parses the variable list for the `cache` construct.

clang/include/clang/Parse/RAIIObjectsForParser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ namespace clang {
323323

324324
/// This can be used to restore the state early, before the dtor
325325
/// is run.
326-
void restore() { P.OpenMPDirectiveParsing = OldVal; }
326+
void restore() { P.OpenACCDirectiveParsing = OldVal; }
327327

328328
~ParsingOpenACCDirectiveRAII() { restore(); }
329329
};

0 commit comments

Comments
 (0)