Skip to content

Commit 7672e1c

Browse files
authored
Merge branch 'main' into FuncAttrPrinting
2 parents 896cc91 + 3a25a4a commit 7672e1c

File tree

259 files changed

+9265
-3001
lines changed

Some content is hidden

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

259 files changed

+9265
-3001
lines changed

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,12 @@ class MCPlusBuilder {
18881888
llvm_unreachable("not implemented");
18891889
}
18901890

1891+
/// Update operand of BTI instruction.
1892+
virtual void updateBTIVariant(MCInst &Inst, bool CallTarget,
1893+
bool JumpTarget) const {
1894+
llvm_unreachable("not implemented");
1895+
}
1896+
18911897
/// Store \p Target absolute address to \p RegName
18921898
virtual InstructionListType materializeAddress(const MCSymbol *Target,
18931899
MCContext *Ctx,

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2800,6 +2800,14 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
28002800
Inst.getOpcode() == AArch64::PACIBSP;
28012801
}
28022802

2803+
void updateBTIVariant(MCInst &Inst, bool CallTarget,
2804+
bool JumpTarget) const override {
2805+
assert(Inst.getOpcode() == AArch64::HINT && "Not a BTI instruction.");
2806+
unsigned HintNum = getBTIHintNum(CallTarget, JumpTarget);
2807+
Inst.clear();
2808+
Inst.addOperand(MCOperand::createImm(HintNum));
2809+
}
2810+
28032811
InstructionListType materializeAddress(const MCSymbol *Target, MCContext *Ctx,
28042812
MCPhysReg RegName,
28052813
int64_t Addend = 0) const override {

bolt/unittests/Core/MCPlusBuilder.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,20 +156,26 @@ TEST_P(MCPlusBuilderTester, AArch64_BTI) {
156156
ASSERT_EQ(II->getOpcode(), AArch64::HINT);
157157
ASSERT_EQ(II->getOperand(0).getImm(), 38);
158158
ASSERT_TRUE(BC->MIB->isBTILandingPad(*II, true, true));
159+
BC->MIB->updateBTIVariant(*II, true, false);
160+
ASSERT_TRUE(BC->MIB->isBTILandingPad(*II, true, false));
159161

160162
MCInst BTIj;
161163
BC->MIB->createBTI(BTIj, false, true);
162164
II = BB->addInstruction(BTIj);
163165
ASSERT_EQ(II->getOpcode(), AArch64::HINT);
164166
ASSERT_EQ(II->getOperand(0).getImm(), 36);
165167
ASSERT_TRUE(BC->MIB->isBTILandingPad(*II, false, true));
168+
BC->MIB->updateBTIVariant(*II, true, true);
169+
ASSERT_TRUE(BC->MIB->isBTILandingPad(*II, true, true));
166170

167171
MCInst BTIc;
168172
BC->MIB->createBTI(BTIc, true, false);
169173
II = BB->addInstruction(BTIc);
170174
ASSERT_EQ(II->getOpcode(), AArch64::HINT);
171175
ASSERT_EQ(II->getOperand(0).getImm(), 34);
172176
ASSERT_TRUE(BC->MIB->isBTILandingPad(*II, true, false));
177+
BC->MIB->updateBTIVariant(*II, false, true);
178+
ASSERT_TRUE(BC->MIB->isBTILandingPad(*II, false, true));
173179

174180
#ifndef NDEBUG
175181
MCInst BTIinvalid;

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4765,9 +4765,21 @@ the configuration (without a prefix: ``Auto``).
47654765
Decimal: 3
47664766
Hex: -1
47674767

4768-
You can also specify a minimum number of digits (``BinaryMinDigits``,
4769-
``DecimalMinDigits``, and ``HexMinDigits``) the integer literal must
4770-
have in order for the separators to be inserted.
4768+
You can also specify a minimum number of digits
4769+
(``BinaryMinDigitsInsert``, ``DecimalMinDigitsInsert``, and
4770+
``HexMinDigitsInsert``) the integer literal must have in order for the
4771+
separators to be inserted, and a maximum number of digits
4772+
(``BinaryMaxDigitsRemove``, ``DecimalMaxDigitsRemove``, and
4773+
``HexMaxDigitsRemove``) until the separators are removed. This divides the
4774+
literals in 3 regions, always without separator (up until including
4775+
``xxxMaxDigitsRemove``), maybe with, or without separators (up until
4776+
excluding ``xxxMinDigitsInsert``), and finally always with separators.
4777+
4778+
.. note::
4779+
4780+
``BinaryMinDigits``, ``DecimalMinDigits``, and ``HexMinDigits`` are
4781+
deprecated and renamed to ``BinaryMinDigitsInsert``,
4782+
``DecimalMinDigitsInsert``, and ``HexMinDigitsInsert``, respectively.
47714783

47724784
* ``int8_t Binary`` Format separators in binary literals.
47734785

@@ -4778,15 +4790,28 @@ the configuration (without a prefix: ``Auto``).
47784790
/* 3: */ b = 0b100'111'101'101;
47794791
/* 4: */ b = 0b1001'1110'1101;
47804792
4781-
* ``int8_t BinaryMinDigits`` Format separators in binary literals with a minimum number of digits.
4793+
* ``int8_t BinaryMinDigitsInsert`` Format separators in binary literals with a minimum number of digits.
47824794

47834795
.. code-block:: text
47844796
47854797
// Binary: 3
4786-
// BinaryMinDigits: 7
4798+
// BinaryMinDigitsInsert: 7
47874799
b1 = 0b101101;
47884800
b2 = 0b1'101'101;
47894801
4802+
* ``int8_t BinaryMaxDigitsRemove`` Remove separators in binary literals with a maximum number of digits.
4803+
4804+
.. code-block:: text
4805+
4806+
// Binary: 3
4807+
// BinaryMinDigitsInsert: 7
4808+
// BinaryMaxDigitsRemove: 4
4809+
b0 = 0b1011; // Always removed.
4810+
b1 = 0b101101; // Not added.
4811+
b2 = 0b1'01'101; // Not removed, not corrected.
4812+
b3 = 0b1'101'101; // Always added.
4813+
b4 = 0b10'1101; // Corrected to 0b101'101.
4814+
47904815
* ``int8_t Decimal`` Format separators in decimal literals.
47914816

47924817
.. code-block:: text
@@ -4795,15 +4820,28 @@ the configuration (without a prefix: ``Auto``).
47954820
/* 0: */ d = 184467'440737'0'95505'92ull;
47964821
/* 3: */ d = 18'446'744'073'709'550'592ull;
47974822
4798-
* ``int8_t DecimalMinDigits`` Format separators in decimal literals with a minimum number of digits.
4823+
* ``int8_t DecimalMinDigitsInsert`` Format separators in decimal literals with a minimum number of digits.
47994824

48004825
.. code-block:: text
48014826
48024827
// Decimal: 3
4803-
// DecimalMinDigits: 5
4828+
// DecimalMinDigitsInsert: 5
48044829
d1 = 2023;
48054830
d2 = 10'000;
48064831
4832+
* ``int8_t DecimalMaxDigitsRemove`` Remove separators in decimal literals with a maximum number of digits.
4833+
4834+
.. code-block:: text
4835+
4836+
// Decimal: 3
4837+
// DecimalMinDigitsInsert: 7
4838+
// DecimalMaxDigitsRemove: 4
4839+
d0 = 2023; // Always removed.
4840+
d1 = 123456; // Not added.
4841+
d2 = 1'23'456; // Not removed, not corrected.
4842+
d3 = 5'000'000; // Always added.
4843+
d4 = 1'23'45; // Corrected to 12'345.
4844+
48074845
* ``int8_t Hex`` Format separators in hexadecimal literals.
48084846

48094847
.. code-block:: text
@@ -4812,16 +4850,30 @@ the configuration (without a prefix: ``Auto``).
48124850
/* 0: */ h = 0xDEAD'BEEF'DE'AD'BEE'Fuz;
48134851
/* 2: */ h = 0xDE'AD'BE'EF'DE'AD'BE'EFuz;
48144852
4815-
* ``int8_t HexMinDigits`` Format separators in hexadecimal literals with a minimum number of
4853+
* ``int8_t HexMinDigitsInsert`` Format separators in hexadecimal literals with a minimum number of
48164854
digits.
48174855

48184856
.. code-block:: text
48194857
48204858
// Hex: 2
4821-
// HexMinDigits: 6
4859+
// HexMinDigitsInsert: 6
48224860
h1 = 0xABCDE;
48234861
h2 = 0xAB'CD'EF;
48244862
4863+
* ``int8_t HexMaxDigitsRemove`` Remove separators in hexadecimal literals with a maximum number of
4864+
digits.
4865+
4866+
.. code-block:: text
4867+
4868+
// Hex: 2
4869+
// HexMinDigitsInsert: 6
4870+
// HexMaxDigitsRemove: 4
4871+
h0 = 0xAFFE; // Always removed.
4872+
h1 = 0xABCDE; // Not added.
4873+
h2 = 0xABC'DE; // Not removed, not corrected.
4874+
h3 = 0xAB'CD'EF; // Always added.
4875+
h4 = 0xABCD'E; // Corrected to 0xA'BC'DE.
4876+
48254877
48264878
.. _JavaImportGroups:
48274879

clang/docs/OpenMPSupport.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,8 @@ implementation.
580580
| need_device_addr modifier for adjust_args clause | :part:`partial` | :none:`unclaimed` | Parsing/Sema: https://github.com/llvm/llvm-project/pull/143442 |
581581
| | | | https://github.com/llvm/llvm-project/pull/149586 |
582582
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
583+
| need_device_ptr modifier for adjust_args clause | :part:`unclaimed` | :none:`unclaimed` | |
584+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
583585
| Prescriptive num_threads | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/160659 |
584586
| | | | https://github.com/llvm/llvm-project/pull/146403 |
585587
| | | | https://github.com/llvm/llvm-project/pull/146404 |
@@ -631,7 +633,9 @@ implementation.
631633
| | | | RT: @abhinavgaba (https://github.com/llvm/llvm-project/pull/149036, |
632634
| | | | https://github.com/llvm/llvm-project/pull/158370) |
633635
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
634-
636+
| need_device_ptr modifier for adjust_args clause | :part:`partial` | :none:`unclaimed` | Clang Parsing/Sema: https://github.com/llvm/llvm-project/pull/168905 |
637+
| | | | https://github.com/llvm/llvm-project/pull/169558 |
638+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
635639

636640
OpenMP Extensions
637641
=================

clang/docs/ReleaseNotes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ Improvements to Clang's diagnostics
396396
- Fixed false positives in ``-Waddress-of-packed-member`` diagnostics when
397397
potential misaligned members get processed before they can get discarded.
398398
(#GH144729)
399+
- Fix a false positive warning in ``-Wignored-qualifiers`` when the return type is undeduced. (#GH43054)
399400

400401
- Clang now emits a diagnostic with the correct message in case of assigning to const reference captured in lambda. (#GH105647)
401402

@@ -703,6 +704,9 @@ clang-format
703704
``AlignAfterOpenBracket`` option, and make ``AlignAfterOpenBracket`` a
704705
``bool`` type.
705706
- Add ``AlignPPAndNotPP`` suboption to ``AlignTrailingComments``.
707+
- Rename ``(Binary|Decimal|Hex)MinDigits`` to ``...MinDigitsInsert`` and add
708+
``(Binary|Decimal|Hex)MaxDigitsSeparator`` suboptions to
709+
``IntegerLiteralSeparator``.
706710

707711
libclang
708712
--------
@@ -763,6 +767,9 @@ OpenMP Support
763767
- Updated parsing and semantic analysis support for ``nowait`` clause to accept
764768
optional argument in OpenMP >= 60.
765769
- Added support for ``default`` clause on ``target`` directive.
770+
- Added parsing and semantic analysis support for ``need_device_ptr`` modifier
771+
to accept an optional fallback argument (``fb_nullify`` or ``fb_preserve``)
772+
with OpenMP >= 61.
766773

767774
Improvements
768775
^^^^^^^^^^^^

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,7 +2371,8 @@ let Features = "avx512vl",
23712371
def pternlogq256_maskz : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, _Vector<4, long long int>, _Vector<4, long long int>, _Constant int, unsigned char)">;
23722372
}
23732373

2374-
let Features = "avx512f", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
2374+
let Features = "avx512f",
2375+
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
23752376
def shuf_f32x4 : X86Builtin<"_Vector<16, float>(_Vector<16, float>, _Vector<16, float>, _Constant int)">;
23762377
def shuf_f64x2 : X86Builtin<"_Vector<8, double>(_Vector<8, double>, _Vector<8, double>, _Constant int)">;
23772378
def shuf_i32x4 : X86Builtin<"_Vector<16, int>(_Vector<16, int>, _Vector<16, int>, _Constant int)">;
@@ -2391,7 +2392,8 @@ let Features = "avx512f", Attributes = [NoThrow, Const, Constexpr, RequiredVecto
23912392
: X86Builtin<"_Vector<16, float>(_Vector<16, float>, _Vector<16, int>)">;
23922393
}
23932394

2394-
let Features = "avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] in {
2395+
let Features = "avx512vl",
2396+
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256>] in {
23952397
def shuf_f32x4_256 : X86Builtin<"_Vector<8, float>(_Vector<8, float>, _Vector<8, float>, _Constant int)">;
23962398
def shuf_f64x2_256 : X86Builtin<"_Vector<4, double>(_Vector<4, double>, _Vector<4, double>, _Constant int)">;
23972399
def shuf_i32x4_256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Vector<8, int>, _Constant int)">;

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,9 +851,6 @@ def warn_drv_sarif_format_unstable : Warning<
851851
"diagnostic formatting in SARIF mode is currently unstable">,
852852
InGroup<DiagGroup<"sarif-format-unstable">>;
853853

854-
def err_drv_riscv_unsupported_with_linker_relaxation : Error<
855-
"%0 is unsupported with RISC-V linker relaxation (-mrelax)">;
856-
857854
def warn_drv_loongarch_conflicting_implied_val : Warning<
858855
"ignoring '%0' as it conflicts with that implied by '%1' (%2)">,
859856
InGroup<OptionIgnored>;

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4612,6 +4612,16 @@ def CIR_ExpOp : CIR_UnaryFPToFPBuiltinOp<"exp", "ExpOp"> {
46124612
}];
46134613
}
46144614

4615+
def CIR_Exp2Op : CIR_UnaryFPToFPBuiltinOp<"exp2", "Exp2Op"> {
4616+
let summary = "Computes the floating-point base-2 exponential value";
4617+
let description = [{
4618+
`cir.exp2` computes the base-2 exponential of a floating-point operand and
4619+
returns a result of the same type.
4620+
4621+
Floating-point exceptions are ignored, and it does not set `errno`.
4622+
}];
4623+
}
4624+
46154625
def CIR_FAbsOp : CIR_UnaryFPToFPBuiltinOp<"fabs", "FAbsOp"> {
46164626
let summary = "Computes the floating-point absolute value";
46174627
let description = [{

clang/include/clang/Format/Format.h

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3275,9 +3275,20 @@ struct FormatStyle {
32753275
/// Hex: -1
32763276
/// \endcode
32773277
///
3278-
/// You can also specify a minimum number of digits (``BinaryMinDigits``,
3279-
/// ``DecimalMinDigits``, and ``HexMinDigits``) the integer literal must
3280-
/// have in order for the separators to be inserted.
3278+
/// You can also specify a minimum number of digits
3279+
/// (``BinaryMinDigitsInsert``, ``DecimalMinDigitsInsert``, and
3280+
/// ``HexMinDigitsInsert``) the integer literal must have in order for the
3281+
/// separators to be inserted, and a maximum number of digits
3282+
/// (``BinaryMaxDigitsRemove``, ``DecimalMaxDigitsRemove``, and
3283+
/// ``HexMaxDigitsRemove``) until the separators are removed. This divides the
3284+
/// literals in 3 regions, always without separator (up until including
3285+
/// ``xxxMaxDigitsRemove``), maybe with, or without separators (up until
3286+
/// excluding ``xxxMinDigitsInsert``), and finally always with separators.
3287+
/// \note
3288+
/// ``BinaryMinDigits``, ``DecimalMinDigits``, and ``HexMinDigits`` are
3289+
/// deprecated and renamed to ``BinaryMinDigitsInsert``,
3290+
/// ``DecimalMinDigitsInsert``, and ``HexMinDigitsInsert``, respectively.
3291+
/// \endnote
32813292
struct IntegerLiteralSeparatorStyle {
32823293
/// Format separators in binary literals.
32833294
/// \code{.text}
@@ -3290,11 +3301,23 @@ struct FormatStyle {
32903301
/// Format separators in binary literals with a minimum number of digits.
32913302
/// \code{.text}
32923303
/// // Binary: 3
3293-
/// // BinaryMinDigits: 7
3304+
/// // BinaryMinDigitsInsert: 7
32943305
/// b1 = 0b101101;
32953306
/// b2 = 0b1'101'101;
32963307
/// \endcode
3297-
int8_t BinaryMinDigits;
3308+
int8_t BinaryMinDigitsInsert;
3309+
/// Remove separators in binary literals with a maximum number of digits.
3310+
/// \code{.text}
3311+
/// // Binary: 3
3312+
/// // BinaryMinDigitsInsert: 7
3313+
/// // BinaryMaxDigitsRemove: 4
3314+
/// b0 = 0b1011; // Always removed.
3315+
/// b1 = 0b101101; // Not added.
3316+
/// b2 = 0b1'01'101; // Not removed, not corrected.
3317+
/// b3 = 0b1'101'101; // Always added.
3318+
/// b4 = 0b10'1101; // Corrected to 0b101'101.
3319+
/// \endcode
3320+
int8_t BinaryMaxDigitsRemove;
32983321
/// Format separators in decimal literals.
32993322
/// \code{.text}
33003323
/// /* -1: */ d = 18446744073709550592ull;
@@ -3305,11 +3328,23 @@ struct FormatStyle {
33053328
/// Format separators in decimal literals with a minimum number of digits.
33063329
/// \code{.text}
33073330
/// // Decimal: 3
3308-
/// // DecimalMinDigits: 5
3331+
/// // DecimalMinDigitsInsert: 5
33093332
/// d1 = 2023;
33103333
/// d2 = 10'000;
33113334
/// \endcode
3312-
int8_t DecimalMinDigits;
3335+
int8_t DecimalMinDigitsInsert;
3336+
/// Remove separators in decimal literals with a maximum number of digits.
3337+
/// \code{.text}
3338+
/// // Decimal: 3
3339+
/// // DecimalMinDigitsInsert: 7
3340+
/// // DecimalMaxDigitsRemove: 4
3341+
/// d0 = 2023; // Always removed.
3342+
/// d1 = 123456; // Not added.
3343+
/// d2 = 1'23'456; // Not removed, not corrected.
3344+
/// d3 = 5'000'000; // Always added.
3345+
/// d4 = 1'23'45; // Corrected to 12'345.
3346+
/// \endcode
3347+
int8_t DecimalMaxDigitsRemove;
33133348
/// Format separators in hexadecimal literals.
33143349
/// \code{.text}
33153350
/// /* -1: */ h = 0xDEADBEEFDEADBEEFuz;
@@ -3321,15 +3356,36 @@ struct FormatStyle {
33213356
/// digits.
33223357
/// \code{.text}
33233358
/// // Hex: 2
3324-
/// // HexMinDigits: 6
3359+
/// // HexMinDigitsInsert: 6
33253360
/// h1 = 0xABCDE;
33263361
/// h2 = 0xAB'CD'EF;
33273362
/// \endcode
3328-
int8_t HexMinDigits;
3363+
int8_t HexMinDigitsInsert;
3364+
/// Remove separators in hexadecimal literals with a maximum number of
3365+
/// digits.
3366+
/// \code{.text}
3367+
/// // Hex: 2
3368+
/// // HexMinDigitsInsert: 6
3369+
/// // HexMaxDigitsRemove: 4
3370+
/// h0 = 0xAFFE; // Always removed.
3371+
/// h1 = 0xABCDE; // Not added.
3372+
/// h2 = 0xABC'DE; // Not removed, not corrected.
3373+
/// h3 = 0xAB'CD'EF; // Always added.
3374+
/// h4 = 0xABCD'E; // Corrected to 0xA'BC'DE.
3375+
/// \endcode
3376+
int8_t HexMaxDigitsRemove;
33293377
bool operator==(const IntegerLiteralSeparatorStyle &R) const {
3330-
return Binary == R.Binary && BinaryMinDigits == R.BinaryMinDigits &&
3331-
Decimal == R.Decimal && DecimalMinDigits == R.DecimalMinDigits &&
3332-
Hex == R.Hex && HexMinDigits == R.HexMinDigits;
3378+
return Binary == R.Binary &&
3379+
BinaryMinDigitsInsert == R.BinaryMinDigitsInsert &&
3380+
BinaryMaxDigitsRemove == R.BinaryMaxDigitsRemove &&
3381+
Decimal == R.Decimal &&
3382+
DecimalMinDigitsInsert == R.DecimalMinDigitsInsert &&
3383+
DecimalMaxDigitsRemove == R.DecimalMaxDigitsRemove &&
3384+
Hex == R.Hex && HexMinDigitsInsert == R.HexMinDigitsInsert &&
3385+
HexMaxDigitsRemove == R.HexMaxDigitsRemove;
3386+
}
3387+
bool operator!=(const IntegerLiteralSeparatorStyle &R) const {
3388+
return !operator==(R);
33333389
}
33343390
};
33353391

0 commit comments

Comments
 (0)