Skip to content

Commit 3676d4d

Browse files
authored
Merge branch 'main' into fix_padding_shape
2 parents f494302 + f925ecb commit 3676d4d

File tree

462 files changed

+29168
-18935
lines changed

Some content is hidden

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

462 files changed

+29168
-18935
lines changed

.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/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,16 @@ TARGET_BUILTIN(__builtin_amdgcn_global_load_monitor_b128, "V4iV4i*1Ii", "nc", "g
651651
TARGET_BUILTIN(__builtin_amdgcn_flat_load_monitor_b32, "ii*0Ii", "nc", "gfx1250-insts")
652652
TARGET_BUILTIN(__builtin_amdgcn_flat_load_monitor_b64, "V2iV2i*0Ii", "nc", "gfx1250-insts")
653653
TARGET_BUILTIN(__builtin_amdgcn_flat_load_monitor_b128, "V4iV4i*0Ii", "nc", "gfx1250-insts")
654+
TARGET_BUILTIN(__builtin_amdgcn_global_load_async_to_lds_b8, "vc*1c*3IiIi", "nc", "gfx1250-insts")
655+
TARGET_BUILTIN(__builtin_amdgcn_global_load_async_to_lds_b32, "vi*1i*3IiIi", "nc", "gfx1250-insts")
656+
TARGET_BUILTIN(__builtin_amdgcn_global_load_async_to_lds_b64, "vV2i*1V2i*3IiIi", "nc", "gfx1250-insts")
657+
TARGET_BUILTIN(__builtin_amdgcn_global_load_async_to_lds_b128, "vV4i*1V4i*3IiIi", "nc", "gfx1250-insts")
658+
TARGET_BUILTIN(__builtin_amdgcn_global_store_async_from_lds_b8, "vc*1c*3IiIi", "nc", "gfx1250-insts")
659+
TARGET_BUILTIN(__builtin_amdgcn_global_store_async_from_lds_b32, "vi*1i*3IiIi", "nc", "gfx1250-insts")
660+
TARGET_BUILTIN(__builtin_amdgcn_global_store_async_from_lds_b64, "vV2i*1V2i*3IiIi", "nc", "gfx1250-insts")
661+
TARGET_BUILTIN(__builtin_amdgcn_global_store_async_from_lds_b128, "vV4i*1V4i*3IiIi", "nc", "gfx1250-insts")
662+
TARGET_BUILTIN(__builtin_amdgcn_ds_atomic_async_barrier_arrive_b64, "vLi*3", "nc", "gfx1250-insts")
663+
TARGET_BUILTIN(__builtin_amdgcn_ds_atomic_barrier_arrive_rtn_b64, "LiLi*3Li", "nc", "gfx1250-insts")
654664

655665
TARGET_BUILTIN(__builtin_amdgcn_tensor_load_to_lds, "vV4iV8iV4iV4iIi", "nc", "gfx1250-insts")
656666
TARGET_BUILTIN(__builtin_amdgcn_tensor_load_to_lds_d2, "vV4iV8iIi", "nc", "gfx1250-insts")
@@ -670,9 +680,6 @@ TARGET_BUILTIN(__builtin_amdgcn_ds_load_tr16_b128_v8i16, "V8sV8s*3", "nc", "gfx1
670680
TARGET_BUILTIN(__builtin_amdgcn_ds_load_tr16_b128_v8f16, "V8hV8h*3", "nc", "gfx1250-insts,wavefrontsize32")
671681
TARGET_BUILTIN(__builtin_amdgcn_ds_load_tr16_b128_v8bf16, "V8yV8y*3", "nc", "gfx1250-insts,wavefrontsize32")
672682

673-
TARGET_BUILTIN(__builtin_amdgcn_ds_atomic_async_barrier_arrive_b64, "vLi*3", "nc", "gfx1250-insts")
674-
TARGET_BUILTIN(__builtin_amdgcn_ds_atomic_barrier_arrive_rtn_b64, "LiLi*3Li", "nc", "gfx1250-insts")
675-
676683
TARGET_BUILTIN(__builtin_amdgcn_s_setprio_inc_wg, "vIs", "n", "setprio-inc-wg-inst")
677684
TARGET_BUILTIN(__builtin_amdgcn_s_monitor_sleep, "vIs", "n", "gfx1250-insts")
678685

clang/include/clang/Basic/DiagnosticSemaKinds.td

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

clang/include/clang/Basic/FileManager.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,6 @@ class FileManager : public RefCountedBase<FileManager> {
237237
FileEntryRef getVirtualFileRef(StringRef Filename, off_t Size,
238238
time_t ModificationTime);
239239

240-
LLVM_DEPRECATED("Functions returning FileEntry are deprecated.",
241-
"getVirtualFileRef()")
242-
const FileEntry *getVirtualFile(StringRef Filename, off_t Size,
243-
time_t ModificationTime);
244-
245240
/// Retrieve a FileEntry that bypasses VFE, which is expected to be a virtual
246241
/// file entry, to access the real file. The returned FileEntry will have
247242
/// the same filename as FE but a different identity and its own stat.

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/Builder/CIRBaseBuilder.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
7575
return getConstant(loc, cir::IntAttr::get(ty, value));
7676
}
7777

78+
mlir::Value getSignedInt(mlir::Location loc, int64_t val, unsigned numBits) {
79+
auto type = cir::IntType::get(getContext(), numBits, /*isSigned=*/true);
80+
return getConstAPInt(loc, type,
81+
llvm::APInt(numBits, val, /*isSigned=*/true));
82+
}
83+
7884
mlir::Value getUnsignedInt(mlir::Location loc, uint64_t val,
7985
unsigned numBits) {
8086
auto type = cir::IntType::get(getContext(), numBits, /*isSigned=*/false);

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: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,8 @@ def CIR_ConditionOp : CIR_Op<"condition", [
607607
//===----------------------------------------------------------------------===//
608608

609609
defvar CIR_YieldableScopes = [
610-
"ArrayCtor", "CaseOp", "DoWhileOp", "ForOp", "IfOp", "ScopeOp", "SwitchOp",
611-
"TernaryOp", "WhileOp"
610+
"ArrayCtor", "ArrayDtor", "CaseOp", "DoWhileOp", "ForOp", "IfOp", "ScopeOp",
611+
"SwitchOp", "TernaryOp", "WhileOp"
612612
];
613613

614614
def CIR_YieldOp : CIR_Op<"yield", [
@@ -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
);
@@ -1946,6 +1946,10 @@ def CIR_FuncOp : CIR_Op<"func", [
19461946
The function linkage information is specified by `linkage`, as defined by
19471947
`GlobalLinkageKind` attribute.
19481948

1949+
The `no_proto` keyword is used to identify functions that were declared
1950+
without a prototype and, consequently, may contain calls with invalid
1951+
arguments and undefined behavior.
1952+
19491953
Example:
19501954

19511955
```mlir
@@ -1964,6 +1968,7 @@ def CIR_FuncOp : CIR_Op<"func", [
19641968
let arguments = (ins SymbolNameAttr:$sym_name,
19651969
CIR_VisibilityAttr:$global_visibility,
19661970
TypeAttrOf<CIR_FuncType>:$function_type,
1971+
UnitAttr:$no_proto,
19671972
UnitAttr:$dso_local,
19681973
DefaultValuedAttr<CIR_GlobalLinkageKind,
19691974
"cir::GlobalLinkageKind::ExternalLinkage">:$linkage,
@@ -2005,13 +2010,6 @@ def CIR_FuncOp : CIR_Op<"func", [
20052010
return getFunctionType().getReturnTypes();
20062011
}
20072012

2008-
// TODO(cir): this should be an operand attribute, but for now we just hard-
2009-
// wire this as a function. Will later add a $no_proto argument to this op.
2010-
bool getNoProto() {
2011-
assert(!cir::MissingFeatures::opFuncNoProto());
2012-
return false;
2013-
}
2014-
20152013
//===------------------------------------------------------------------===//
20162014
// SymbolOpInterface Methods
20172015
//===------------------------------------------------------------------===//
@@ -2229,7 +2227,7 @@ def CIR_TrapOp : CIR_Op<"trap", [Terminator]> {
22292227
}
22302228

22312229
//===----------------------------------------------------------------------===//
2232-
// ArrayCtor
2230+
// ArrayCtor & ArrayDtor
22332231
//===----------------------------------------------------------------------===//
22342232

22352233
class CIR_ArrayInitDestroy<string mnemonic> : CIR_Op<mnemonic> {
@@ -2260,7 +2258,9 @@ def CIR_ArrayCtor : CIR_ArrayInitDestroy<"array.ctor"> {
22602258
let description = [{
22612259
Initialize each array element using the same C++ constructor. This
22622260
operation has one region, with one single block. The block has an
2263-
incoming argument for the current array index to initialize.
2261+
incoming argument for the current array element to initialize.
2262+
2263+
Example:
22642264

22652265
```mlir
22662266
cir.array.ctor(%0 : !cir.ptr<!cir.array<!rec_S x 42>>) {
@@ -2272,6 +2272,25 @@ def CIR_ArrayCtor : CIR_ArrayInitDestroy<"array.ctor"> {
22722272
}];
22732273
}
22742274

2275+
def CIR_ArrayDtor : CIR_ArrayInitDestroy<"array.dtor"> {
2276+
let summary = "Destroy array elements with C++ dtors";
2277+
let description = [{
2278+
Destroy each array element using the same C++ destructor. This
2279+
operation has one region, with one single block. The block has an
2280+
incoming argument for the current array element to destruct.
2281+
2282+
Example:
2283+
2284+
```mlir
2285+
cir.array.dtor(%0 : !cir.ptr<!cir.array<!rec_S x 42>>) {
2286+
^bb0(%arg0: !cir.ptr<!rec_S>):
2287+
cir.call @some_dtor(%arg0) : (!cir.ptr<!rec_S>) -> ()
2288+
cir.yield
2289+
}
2290+
```
2291+
}];
2292+
}
2293+
22752294
//===----------------------------------------------------------------------===//
22762295
// VecCreate
22772296
//===----------------------------------------------------------------------===//
@@ -2911,6 +2930,28 @@ def CIR_BitCtzOp : CIR_BitZeroCountOpBase<"ctz",
29112930
}];
29122931
}
29132932

2933+
def CIR_BitFfsOp : CIR_BitOpBase<"ffs", CIR_SIntOfWidths<[32, 64]>> {
2934+
let summary = "Get the position of the least significant 1-bit in input";
2935+
let description = [{
2936+
Compute the 1-based position of the least significant 1-bit of the input.
2937+
2938+
The input integer must be a signed integer. The `cir.ffs` operation returns
2939+
one plus the index of the least significant 1-bit of the input signed
2940+
integer. If the input integer is 0, `cir.ffs` yields 0.
2941+
2942+
Example:
2943+
2944+
```mlir
2945+
!s32i = !cir.int<s, 32>
2946+
2947+
// %0 = 0x0010_1000
2948+
%0 = cir.const #cir.int<40> : !s32i
2949+
// #1 will be 4 since the 4th least significant bit is 1.
2950+
%1 = cir.ffs %0 : !s32i
2951+
```
2952+
}];
2953+
}
2954+
29142955
def CIR_BitParityOp : CIR_BitOpBase<"parity", CIR_UIntOfWidths<[32, 64]>> {
29152956
let summary = "Get the parity of input";
29162957
let description = [{

0 commit comments

Comments
 (0)