Skip to content

Commit 1722084

Browse files
committed
Merge from 'main' to 'sycl-web' (82 commits)
CONFLICT (content): Merge conflict in clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
2 parents 615f770 + d462621 commit 1722084

File tree

364 files changed

+11720
-7790
lines changed

Some content is hidden

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

364 files changed

+11720
-7790
lines changed
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
#include <stdio.h>
2-
#include <stdlib.h>
3-
#include <unistd.h>
4-
51
int add(int a, int b) { return a + b; }
62
int minus(int a, int b) { return a - b; }
73
int multiple(int a, int b) { return a * b; }
@@ -15,12 +11,12 @@ int main() {
1511
int a = 16;
1612
int b = 8;
1713

18-
for (int i = 1; i < 100000; i++) {
14+
for (int i = 1; i < 1000000; i++) {
1915
add(a, b);
2016
minus(a, b);
2117
multiple(a, b);
2218
divide(a, b);
2319
}
2420

2521
return 0;
26-
}
22+
}

bolt/utils/nfc-stat-parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def main():
1919
)
2020
parser.add_argument(
2121
"--check_longer_than",
22-
default=0.5,
22+
default=1,
2323
type=float,
2424
help="Only warn on tests longer than X seconds for at least one side",
2525
)

clang/docs/LanguageExtensions.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4650,6 +4650,22 @@ The pragma can take two values: ``on`` and ``off``.
46504650
float v = t + z;
46514651
}
46524652
4653+
``#pragma clang fp reciprocal`` allows control over using reciprocal
4654+
approximations in floating point expressions. When enabled, this
4655+
pragma allows the expression ``x / y`` to be approximated as ``x *
4656+
(1.0 / y)``. This pragma can be used to disable reciprocal
4657+
approximation when it is otherwise enabled for the translation unit
4658+
with the ``-freciprocal-math`` flag or other fast-math options. The
4659+
pragma can take two values: ``on`` and ``off``.
4660+
4661+
.. code-block:: c++
4662+
4663+
float f(float x, float y)
4664+
{
4665+
// Enable floating point reciprocal approximation
4666+
#pragma clang fp reciprocal(on)
4667+
return x / y;
4668+
}
46534669
46544670
``#pragma clang fp contract`` specifies whether the compiler should
46554671
contract a multiply and an addition (or subtraction) into a fused FMA

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ Non-comprehensive list of changes in this release
228228
* ``__builtin_classify_type()`` now classifies ``_BitInt`` values as the return value ``18``
229229
and vector types as return value ``19``, to match GCC 14's behavior.
230230

231+
* Added ``#pragma clang fp reciprocal``.
232+
231233
New Compiler Flags
232234
------------------
233235

@@ -635,6 +637,9 @@ Bug Fixes in This Version
635637
- Fix crash during code generation of C++ coroutine initial suspend when the return
636638
type of await_resume is not trivially destructible.
637639
Fixes (`#63803 <https://github.com/llvm/llvm-project/issues/63803>`_)
640+
- ``__is_trivially_relocatable`` no longer returns true for non-object types
641+
such as references and functions.
642+
Fixes (`#67498 <https://github.com/llvm/llvm-project/issues/67498>`_)
638643
- Fix crash when the object used as a ``static_assert`` message has ``size`` or ``data`` members
639644
which are not member functions.
640645
- Support UDLs in ``static_assert`` message.

clang/include/clang/Basic/Attr.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5318,6 +5318,18 @@ def HLSLGroupSharedAddressSpace : TypeAttr {
53185318
let Documentation = [HLSLGroupSharedAddressSpaceDocs];
53195319
}
53205320

5321+
def HLSLParamModifier : TypeAttr {
5322+
let Spellings = [CustomKeyword<"in">, CustomKeyword<"inout">, CustomKeyword<"out">];
5323+
let Accessors = [Accessor<"isIn", [CustomKeyword<"in">]>,
5324+
Accessor<"isInOut", [CustomKeyword<"inout">]>,
5325+
Accessor<"isOut", [CustomKeyword<"out">]>,
5326+
Accessor<"isAnyOut", [CustomKeyword<"out">, CustomKeyword<"inout">]>,
5327+
Accessor<"isAnyIn", [CustomKeyword<"in">, CustomKeyword<"inout">]>];
5328+
let Subjects = SubjectList<[ParmVar]>;
5329+
let Documentation = [HLSLParamQualifierDocs];
5330+
let Args = [DefaultBoolArgument<"MergedSpelling", /*default*/0, /*fake*/1>];
5331+
}
5332+
53215333
def RandomizeLayout : InheritableAttr {
53225334
let Spellings = [GCC<"randomize_layout">];
53235335
let Subjects = SubjectList<[Record]>;

clang/include/clang/Basic/AttrDocs.td

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8765,6 +8765,25 @@ The full documentation is available here: https://learn.microsoft.com/en-us/wind
87658765
}];
87668766
}
87678767

8768+
def HLSLParamQualifierDocs : Documentation {
8769+
let Category = DocCatVariable;
8770+
let Content = [{
8771+
HLSL function parameters are passed by value. Parameter declarations support
8772+
three qualifiers to denote parameter passing behavior. The three qualifiers are
8773+
`in`, `out` and `inout`.
8774+
8775+
Parameters annotated with `in` or with no annotation are passed by value from
8776+
the caller to the callee.
8777+
8778+
Parameters annotated with `out` are written to the argument after the callee
8779+
returns (Note: arguments values passed into `out` parameters _are not_ copied
8780+
into the callee).
8781+
8782+
Parameters annotated with `inout` are copied into the callee via a temporary,
8783+
and copied back to the argument after the callee returns.
8784+
}];
8785+
}
8786+
87688787
def AnnotateTypeDocs : Documentation {
87698788
let Category = DocCatType;
87708789
let Heading = "annotate_type";

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1594,12 +1594,13 @@ def note_pragma_loop_invalid_vectorize_option : Note<
15941594
"vectorize_width(X, scalable) where X is an integer, or vectorize_width('fixed' or 'scalable')">;
15951595

15961596
def err_pragma_fp_invalid_option : Error<
1597-
"%select{invalid|missing}0 option%select{ %1|}0; expected 'contract', 'reassociate' or 'exceptions'">;
1597+
"%select{invalid|missing}0 option%select{ %1|}0; expected 'contract', 'reassociate', 'reciprocal', or 'exceptions'">;
15981598
def err_pragma_fp_invalid_argument : Error<
15991599
"unexpected argument '%0' to '#pragma clang fp %1'; expected "
16001600
"%select{"
16011601
"'fast' or 'on' or 'off'|"
16021602
"'on' or 'off'|"
1603+
"'on' or 'off'|"
16031604
"'ignore', 'maytrap' or 'strict'|"
16041605
"'source', 'double' or 'extended'}2">;
16051606

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6823,7 +6823,7 @@ def warn_floatingpoint_eq : Warning<
68236823

68246824
def err_setting_eval_method_used_in_unsafe_context : Error <
68256825
"%select{'#pragma clang fp eval_method'|option 'ffp-eval-method'}0 cannot be used with "
6826-
"%select{option 'fapprox-func'|option 'mreassociate'|option 'freciprocal'|option 'ffp-eval-method'|'#pragma clang fp reassociate'}1">;
6826+
"%select{option 'fapprox-func'|option 'mreassociate'|option 'freciprocal'|option 'ffp-eval-method'|'#pragma clang fp reassociate'|'#pragma clang fp reciprocal'}1">;
68276827

68286828
def warn_remainder_division_by_zero : Warning<
68296829
"%select{remainder|division}0 by zero is undefined">,
@@ -12261,6 +12261,7 @@ def err_hlsl_numthreads_argument_oor : Error<"argument '%select{X|Y|Z}0' to numt
1226112261
def err_hlsl_numthreads_invalid : Error<"total number of threads cannot exceed %0">;
1226212262
def err_hlsl_missing_numthreads : Error<"missing numthreads attribute for %0 shader entry">;
1226312263
def err_hlsl_attribute_param_mismatch : Error<"%0 attribute parameters do not match the previous declaration">;
12264+
def err_hlsl_duplicate_parameter_modifier : Error<"duplicate parameter modifier %0">;
1226412265
def err_hlsl_missing_semantic_annotation : Error<
1226512266
"semantic annotations must be present for all parameters of an entry "
1226612267
"function or patch constant function">;
@@ -12276,6 +12277,9 @@ def err_hlsl_pointers_unsupported : Error<
1227612277
def err_hlsl_operator_unsupported : Error<
1227712278
"the '%select{&|*|->}0' operator is unsupported in HLSL">;
1227812279

12280+
def err_hlsl_param_qualifier_mismatch :
12281+
Error<"conflicting parameter qualifier %0 on parameter %1">;
12282+
1227912283
// Layout randomization diagnostics.
1228012284
def err_non_designated_init_used : Error<
1228112285
"a randomized struct can only be initialized with a designated initializer">;

clang/include/clang/Basic/PragmaKinds.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ enum PragmaFloatControlKind {
3434
PFC_Push, // #pragma float_control(push)
3535
PFC_Pop // #pragma float_control(pop)
3636
};
37+
38+
enum PragmaFPKind {
39+
PFK_Contract, // #pragma clang fp contract
40+
PFK_Reassociate, // #pragma clang fp reassociate
41+
PFK_Reciprocal, // #pragma clang fp reciprocal
42+
PFK_Exceptions, // #pragma clang fp exceptions
43+
PFK_EvalMethod // #pragma clang fp eval_method
44+
};
3745
}
3846

3947
#endif

clang/include/clang/Basic/TokenKinds.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,9 @@ KEYWORD(__noinline__ , KEYCUDA)
635635
KEYWORD(cbuffer , KEYHLSL)
636636
KEYWORD(tbuffer , KEYHLSL)
637637
KEYWORD(groupshared , KEYHLSL)
638+
KEYWORD(in , KEYHLSL)
639+
KEYWORD(inout , KEYHLSL)
640+
KEYWORD(out , KEYHLSL)
638641

639642
// OpenMP Type Traits
640643
UNARY_EXPR_OR_TYPE_TRAIT(__builtin_omp_required_simd_align, OpenMPRequiredSimdAlign, KEYALL)

0 commit comments

Comments
 (0)