Skip to content

Commit 3e1c836

Browse files
committed
merge main into amd-staging
2 parents 9778e3e + 29e02d7 commit 3e1c836

File tree

295 files changed

+22374
-16760
lines changed

Some content is hidden

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

295 files changed

+22374
-16760
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
/mlir/**/Transforms/SROA.* @moxinilian
130130

131131
# BOLT
132-
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @yota9 @paschalis-mpeis
132+
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @yota9 @paschalis-mpeis @yozhu
133133

134134
# Bazel build system.
135135
/utils/bazel/ @rupprecht @keith @aaronmondal

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ jobs:
128128
'generic-abi-unstable',
129129
'generic-hardening-mode-debug',
130130
'generic-hardening-mode-extensive',
131+
'generic-hardening-mode-extensive-observe-semantic',
131132
'generic-hardening-mode-fast',
132133
'generic-hardening-mode-fast-with-abi-breaks',
133134
'generic-merged',

.github/workflows/release-tasks.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,31 @@ jobs:
111111
# Called workflows don't have access to secrets by default, so we need to explicitly pass secrets that we use.
112112
secrets:
113113
RELEASE_TASKS_USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
114+
115+
uncomment-download-links:
116+
name: Uncomment download links
117+
runs-on: ubuntu-24.04
118+
permissions:
119+
contents: write # For updating the release message.
120+
needs:
121+
- validate-tag
122+
- release-create
123+
- release-binaries
124+
125+
steps:
126+
- name: Install Dependencies
127+
run: |
128+
sudo apt-get update
129+
sudo apt-get install python3-github
130+
131+
- name: Checkout LLVM
132+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
133+
with:
134+
sparse-checkout: llvm/utils/release/github-upload-release.py
135+
sparse-checkout-cone-mode: false
136+
137+
- name: Uncomment Download Links
138+
env:
139+
GITHUB_TOKEN: ${{ github.token }}
140+
run: |
141+
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --release ${{ needs.validate-tag.outputs.release-version }} uncomment_download_links

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,8 @@ Bug Fixes to C++ Support
395395
- Diagnose binding a reference to ``*nullptr`` during constant evaluation. (#GH48665)
396396
- Suppress ``-Wdeprecated-declarations`` in implicitly generated functions. (#GH147293)
397397
- Fix a crash when deleting a pointer to an incomplete array (#GH150359).
398+
- Fix an assertion failure when expression in assumption attribute
399+
(``[[assume(expr)]]``) creates temporary objects.
398400

399401
Bug Fixes to AST Handling
400402
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9327,8 +9327,28 @@ def err_atomic_builtin_pointer_size : Error<
93279327
"address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
93289328
"type (%0 invalid)">;
93299329
def err_atomic_exclusive_builtin_pointer_size : Error<
9330-
"address argument to load or store exclusive builtin must be a pointer to"
9331-
" 1,2,4 or 8 byte type (%0 invalid)">;
9330+
"address argument to load or store exclusive builtin must be a pointer to "
9331+
// Because the range of legal sizes for load/store exclusive varies with the
9332+
// Arm architecture version, this error message wants to be able to specify
9333+
// various different subsets of the sizes 1, 2, 4, 8. Rather than make a
9334+
// separate diagnostic for each subset, I've arranged here that _this_ error
9335+
// can display any combination of the sizes. For each size there are two
9336+
// %select parameters: the first chooses whether you need a "," or " or " to
9337+
// separate the number from a previous one (or neither), and the second
9338+
// parameter indicates whether to display the number itself.
9339+
//
9340+
// (The very first of these parameters isn't really necessary, since you
9341+
// never want to start with "," or " or " before the first number in the
9342+
// list, but it keeps it simple to make it look exactly like the other cases,
9343+
// and also allows a loop constructing this diagnostic to handle every case
9344+
// exactly the same.)
9345+
"%select{|,| or }1%select{|1}2"
9346+
"%select{|,| or }3%select{|2}4"
9347+
"%select{|,| or }5%select{|4}6"
9348+
"%select{|,| or }7%select{|8}8"
9349+
" byte type (%0 invalid)">;
9350+
def err_atomic_exclusive_builtin_pointer_size_none : Error<
9351+
"load and store exclusive builtins are not available on this architecture">;
93329352
def err_atomic_builtin_ext_int_size : Error<
93339353
"atomic memory operand must have a power-of-two size">;
93349354
def err_atomic_builtin_bit_int_prohibit : Error<

clang/include/clang/Basic/TargetInfo.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,17 @@ class TargetInfo : public TransferrableTargetInfo,
10711071
/// as Custom Datapath.
10721072
uint32_t getARMCDECoprocMask() const { return ARMCDECoprocMask; }
10731073

1074+
/// For ARM targets returns a mask defining which data sizes are suitable for
1075+
/// __builtin_arm_ldrex and __builtin_arm_strex.
1076+
enum {
1077+
ARM_LDREX_B = (1 << 0), /// byte (8-bit)
1078+
ARM_LDREX_H = (1 << 1), /// half (16-bit)
1079+
ARM_LDREX_W = (1 << 2), /// word (32-bit)
1080+
ARM_LDREX_D = (1 << 3), /// double (64-bit)
1081+
};
1082+
1083+
virtual unsigned getARMLDREXMask() const { return 0; }
1084+
10741085
/// Returns whether the passed in string is a valid clobber in an
10751086
/// inline asm statement.
10761087
///

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

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CIR_TypedAttr<string name, string attrMnemonic, list<Trait> traits = []>
4242
let assemblyFormat = [{}];
4343
}
4444

45-
class CIRUnitAttr<string name, string attrMnemonic, list<Trait> traits = []>
45+
class CIR_UnitAttr<string name, string attrMnemonic, list<Trait> traits = []>
4646
: CIR_Attr<name, attrMnemonic, traits> {
4747
let returnType = "bool";
4848
let defaultValue = "false";
@@ -127,7 +127,7 @@ def CIR_BoolAttr : CIR_Attr<"Bool", "bool", [TypedAttrInterface]> {
127127
// ZeroAttr
128128
//===----------------------------------------------------------------------===//
129129

130-
def ZeroAttr : CIR_TypedAttr<"Zero", "zero"> {
130+
def CIR_ZeroAttr : CIR_TypedAttr<"Zero", "zero"> {
131131
let summary = "Attribute to represent zero initialization";
132132
let description = [{
133133
The ZeroAttr is used to indicate zero initialization on structs.
@@ -138,7 +138,7 @@ def ZeroAttr : CIR_TypedAttr<"Zero", "zero"> {
138138
// UndefAttr
139139
//===----------------------------------------------------------------------===//
140140

141-
def UndefAttr : CIR_TypedAttr<"Undef", "undef"> {
141+
def CIR_UndefAttr : CIR_TypedAttr<"Undef", "undef"> {
142142
let summary = "Represent an undef constant";
143143
let description = [{
144144
The UndefAttr represents an undef constant, corresponding to LLVM's notion
@@ -264,7 +264,9 @@ def CIR_FPAttr : CIR_Attr<"FP", "fp", [TypedAttrInterface]> {
264264
// ConstArrayAttr
265265
//===----------------------------------------------------------------------===//
266266

267-
def ConstArrayAttr : CIR_Attr<"ConstArray", "const_array", [TypedAttrInterface]> {
267+
def CIR_ConstArrayAttr : CIR_Attr<"ConstArray", "const_array", [
268+
TypedAttrInterface
269+
]> {
268270
let summary = "A constant array from ArrayAttr or StringRefAttr";
269271
let description = [{
270272
An CIR array attribute is an array of literals of the specified attr types.
@@ -310,8 +312,9 @@ def ConstArrayAttr : CIR_Attr<"ConstArray", "const_array", [TypedAttrInterface]>
310312
// ConstVectorAttr
311313
//===----------------------------------------------------------------------===//
312314

313-
def ConstVectorAttr : CIR_Attr<"ConstVector", "const_vector",
314-
[TypedAttrInterface]> {
315+
def CIR_ConstVectorAttr : CIR_Attr<"ConstVector", "const_vector", [
316+
TypedAttrInterface
317+
]> {
315318
let summary = "A constant vector from ArrayAttr";
316319
let description = [{
317320
A CIR vector attribute is an array of literals of the specified attribute
@@ -342,7 +345,7 @@ def ConstVectorAttr : CIR_Attr<"ConstVector", "const_vector",
342345
// ConstPtrAttr
343346
//===----------------------------------------------------------------------===//
344347

345-
def ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> {
348+
def CIR_ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> {
346349
let summary = "Holds a constant pointer value";
347350
let parameters = (ins
348351
AttributeSelfTypeParameter<"", "::cir::PointerType">:$type,
@@ -371,8 +374,9 @@ def ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> {
371374
// ConstComplexAttr
372375
//===----------------------------------------------------------------------===//
373376

374-
def ConstComplexAttr : CIR_Attr<"ConstComplex", "const_complex",
375-
[TypedAttrInterface]> {
377+
def CIR_ConstComplexAttr : CIR_Attr<"ConstComplex", "const_complex", [
378+
TypedAttrInterface
379+
]> {
376380
let summary = "An attribute that contains a constant complex value";
377381
let description = [{
378382
The `#cir.const_complex` attribute contains a constant value of complex
@@ -454,7 +458,7 @@ def CIR_VisibilityAttr : CIR_EnumAttr<CIR_VisibilityKind, "visibility"> {
454458
// BitfieldInfoAttr
455459
//===----------------------------------------------------------------------===//
456460

457-
def BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> {
461+
def CIR_BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> {
458462
let summary = "Represents info for a bit-field member";
459463
let description = [{
460464
Holds the following information about bitfields: name, storage type, size
@@ -512,5 +516,4 @@ def BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> {
512516
];
513517
}
514518

515-
516519
#endif // CLANG_CIR_DIALECT_IR_CIRATTRS_TD

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

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,7 +1747,7 @@ def CIR_SetBitfieldOp : CIR_Op<"set_bitfield"> {
17471747
let arguments = (ins
17481748
Arg<CIR_PointerType, "the address to store the value", [MemWrite]>:$addr,
17491749
CIR_AnyType:$src,
1750-
BitfieldInfoAttr:$bitfield_info,
1750+
CIR_BitfieldInfoAttr:$bitfield_info,
17511751
DefaultValuedOptionalAttr<I64Attr, "0">:$alignment,
17521752
UnitAttr:$is_volatile
17531753
);
@@ -1834,7 +1834,7 @@ def CIR_GetBitfieldOp : CIR_Op<"get_bitfield"> {
18341834

18351835
let arguments = (ins
18361836
Arg<CIR_PointerType, "the address to load from", [MemRead]>:$addr,
1837-
BitfieldInfoAttr:$bitfield_info,
1837+
CIR_BitfieldInfoAttr:$bitfield_info,
18381838
DefaultValuedOptionalAttr<I64Attr, "0">:$alignment,
18391839
UnitAttr:$is_volatile
18401840
);
@@ -2911,6 +2911,28 @@ def CIR_BitCtzOp : CIR_BitZeroCountOpBase<"ctz",
29112911
}];
29122912
}
29132913

2914+
def CIR_BitFfsOp : CIR_BitOpBase<"ffs", CIR_SIntOfWidths<[32, 64]>> {
2915+
let summary = "Get the position of the least significant 1-bit in input";
2916+
let description = [{
2917+
Compute the 1-based position of the least significant 1-bit of the input.
2918+
2919+
The input integer must be a signed integer. The `cir.ffs` operation returns
2920+
one plus the index of the least significant 1-bit of the input signed
2921+
integer. If the input integer is 0, `cir.ffs` yields 0.
2922+
2923+
Example:
2924+
2925+
```mlir
2926+
!s32i = !cir.int<s, 32>
2927+
2928+
// %0 = 0x0010_1000
2929+
%0 = cir.const #cir.int<40> : !s32i
2930+
// #1 will be 4 since the 4th least significant bit is 1.
2931+
%1 = cir.ffs %0 : !s32i
2932+
```
2933+
}];
2934+
}
2935+
29142936
def CIR_BitParityOp : CIR_BitOpBase<"parity", CIR_UIntOfWidths<[32, 64]>> {
29152937
let summary = "Get the parity of input";
29162938
let description = [{

clang/include/clang/Frontend/FrontendAction.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ class FrontendAction {
8484
/// \return True on success; on failure ExecutionAction() and
8585
/// EndSourceFileAction() will not be called.
8686
virtual bool BeginSourceFileAction(CompilerInstance &CI) {
87+
if (CurrentInput.isPreprocessed())
88+
CI.getPreprocessor().SetMacroExpansionOnlyInDirectives();
8789
return true;
8890
}
8991

@@ -98,7 +100,11 @@ class FrontendAction {
98100
///
99101
/// This is guaranteed to only be called following a successful call to
100102
/// BeginSourceFileAction (and BeginSourceFile).
101-
virtual void EndSourceFileAction() {}
103+
virtual void EndSourceFileAction() {
104+
if (CurrentInput.isPreprocessed())
105+
// Reset the preprocessor macro expansion to the default.
106+
getCompilerInstance().getPreprocessor().SetEnableMacroExpansion();
107+
}
102108

103109
/// Callback at the end of processing a single input, to determine
104110
/// if the output files should be erased or not.

clang/include/clang/Lex/Preprocessor.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,6 +1847,10 @@ class Preprocessor {
18471847
MacroExpansionInDirectivesOverride = true;
18481848
}
18491849

1850+
void SetEnableMacroExpansion() {
1851+
DisableMacroExpansion = MacroExpansionInDirectivesOverride = false;
1852+
}
1853+
18501854
/// Peeks ahead N tokens and returns that token without consuming any
18511855
/// tokens.
18521856
///

0 commit comments

Comments
 (0)