Skip to content

Commit 781bab3

Browse files
authored
Merge branch 'main' into dev/jholewinski/bitstream-remarks-msvc-fix
2 parents 70234ed + 8db1aab commit 781bab3

File tree

260 files changed

+5856
-1145
lines changed

Some content is hidden

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

260 files changed

+5856
-1145
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
/mlir/test/python/ @ftynse @makslevental @stellaraccident @rolfmorel
132132
/mlir/python/ @ftynse @makslevental @stellaraccident @rolfmorel
133133
/mlir/lib/Bindings/Python @makslevental @rolfmorel
134+
/mlir/include/Bindings/Python @makslevental @rolfmorel
134135

135136
# MLIR Mem2Reg/SROA
136137
/mlir/**/Transforms/Mem2Reg.* @moxinilian

clang/include/clang/AST/ASTContext.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2874,11 +2874,11 @@ class ASTContext : public RefCountedBase<ASTContext> {
28742874
/// returned type is guaranteed to be free of any of these, allowing two
28752875
/// canonical types to be compared for exact equality with a simple pointer
28762876
/// comparison.
2877-
CanQualType getCanonicalType(QualType T) const {
2877+
static CanQualType getCanonicalType(QualType T) {
28782878
return CanQualType::CreateUnsafe(T.getCanonicalType());
28792879
}
28802880

2881-
const Type *getCanonicalType(const Type *T) const {
2881+
static const Type *getCanonicalType(const Type *T) {
28822882
return T->getCanonicalTypeInternal().getTypePtr();
28832883
}
28842884

@@ -2890,10 +2890,10 @@ class ASTContext : public RefCountedBase<ASTContext> {
28902890
CanQualType getCanonicalParamType(QualType T) const;
28912891

28922892
/// Determine whether the given types \p T1 and \p T2 are equivalent.
2893-
bool hasSameType(QualType T1, QualType T2) const {
2893+
static bool hasSameType(QualType T1, QualType T2) {
28942894
return getCanonicalType(T1) == getCanonicalType(T2);
28952895
}
2896-
bool hasSameType(const Type *T1, const Type *T2) const {
2896+
static bool hasSameType(const Type *T1, const Type *T2) {
28972897
return getCanonicalType(T1) == getCanonicalType(T2);
28982898
}
28992899

@@ -2921,7 +2921,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
29212921

29222922
/// Determine whether the given types are equivalent after
29232923
/// cvr-qualifiers have been removed.
2924-
bool hasSameUnqualifiedType(QualType T1, QualType T2) const {
2924+
static bool hasSameUnqualifiedType(QualType T1, QualType T2) {
29252925
return getCanonicalType(T1).getTypePtr() ==
29262926
getCanonicalType(T2).getTypePtr();
29272927
}

clang/include/clang/Basic/arm_mve.td

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -831,9 +831,8 @@ multiclass contiguous_load<string mnemonic, PrimitiveType memtype,
831831
NameOverride<mnemonic>;
832832
def: Intrinsic<Vector, (args CPtr<CopyKind<same_size[0], Scalar>>:$addr,
833833
Predicate:$pred),
834-
(IRIntBase<"masked_load", [Vector, CPtr<Vector>]>
835-
(CPtr<Vector> $addr), !srl(memtype.size,3),
836-
$pred, (zeroinit Vector))>,
834+
(masked_load Vector, (CPtr<Vector> $addr),
835+
!srl(memtype.size,3), $pred, (zeroinit Vector))>,
837836
NameOverride<mnemonic # "_z">;
838837
}
839838

@@ -846,9 +845,8 @@ multiclass contiguous_load<string mnemonic, PrimitiveType memtype,
846845
NameOverride<"vld1q">;
847846
def: Intrinsic<Vector, (args CPtr<CopyKind<same_size[0], Scalar>>:$addr,
848847
Predicate:$pred),
849-
(IRIntBase<"masked_load", [Vector, CPtr<Vector>]>
850-
(CPtr<Vector> $addr), !srl(memtype.size,3),
851-
$pred, (zeroinit Vector))>,
848+
(masked_load Vector, (CPtr<Vector> $addr),
849+
!srl(memtype.size,3), $pred, (zeroinit Vector))>,
852850
NameOverride<"vld1q_z">;
853851
}
854852

@@ -863,9 +861,7 @@ multiclass contiguous_load<string mnemonic, PrimitiveType memtype,
863861
NameOverride<mnemonic>;
864862
def: Intrinsic<Vector, (args CPtr<CopyKind<same_size[0], Scalar>>:$addr,
865863
Predicate:$pred),
866-
(extend (IRIntBase<"masked_load",
867-
[NarrowedVecOf<memtype,Vector>,
868-
CPtr<NarrowedVecOf<memtype,Vector>>]>
864+
(extend (masked_load NarrowedVecOf<memtype,Vector>,
869865
(CPtr<NarrowedVecOf<memtype,Vector>> $addr),
870866
!srl(memtype.size,3), $pred,
871867
(zeroinit NarrowedVecOf<memtype,Vector>)),
@@ -890,8 +886,7 @@ multiclass contiguous_store<string mnemonic, PrimitiveType memtype,
890886
NameOverride<mnemonic>;
891887
def: Intrinsic<Void, (args Ptr<CopyKind<same_size[0], Scalar>>:$addr,
892888
Vector:$value, Predicate:$pred),
893-
(IRIntBase<"masked_store", [Vector, Ptr<Vector>]>
894-
$value, (Ptr<Vector> $addr),
889+
(masked_store $value, (Ptr<Vector> $addr),
895890
!srl(memtype.size,3), $pred)>,
896891
NameOverride<mnemonic # "_p">;
897892
}
@@ -907,8 +902,7 @@ multiclass contiguous_store<string mnemonic, PrimitiveType memtype,
907902
NameOverride<"vst1q">;
908903
def: Intrinsic<Void, (args Ptr<CopyKind<same_size[0], Scalar>>:$addr,
909904
Vector:$value, Predicate:$pred),
910-
(IRIntBase<"masked_store", [Vector, Ptr<Vector>]>
911-
$value, (Ptr<Vector> $addr),
905+
(masked_store $value, (Ptr<Vector> $addr),
912906
!srl(memtype.size,3), $pred)>,
913907
NameOverride<"vst1q_p">;
914908
}
@@ -925,9 +919,7 @@ multiclass contiguous_store<string mnemonic, PrimitiveType memtype,
925919
NameOverride<mnemonic>;
926920
def: Intrinsic<Void, (args Ptr<CopyKind<same_size[0], Scalar>>:$addr,
927921
Vector:$value, Predicate:$pred),
928-
(IRIntBase<"masked_store",
929-
[NarrowedVecOf<memtype,Vector>,
930-
Ptr<NarrowedVecOf<memtype,Vector>>]>
922+
(masked_store
931923
(trunc $value, NarrowedVecOf<memtype,Vector>),
932924
(Ptr<NarrowedVecOf<memtype,Vector>> $addr),
933925
!srl(memtype.size,3), $pred)>,

clang/include/clang/Basic/arm_mve_defs.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ def unzip: CGHelperFn<"VectorUnzip"> {
134134
}
135135
def zip: CGHelperFn<"VectorZip">;
136136

137+
def masked_load: IRBuilder<"CreateMaskedLoad"> {
138+
let special_params = [IRBuilderIntParam<2, "Align">];
139+
}
140+
def masked_store: IRBuilder<"CreateMaskedStore"> {
141+
let special_params = [IRBuilderIntParam<2, "Align">];
142+
}
143+
137144
// Trivial 'codegen' function that just returns its argument. Useful
138145
// for wrapping up a variable name like $foo into a thing you can pass
139146
// around as type 'dag'.

clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
127127
cir::BoolType getBoolTy() { return cir::BoolType::get(getContext()); }
128128
cir::VoidType getVoidTy() { return cir::VoidType::get(getContext()); }
129129

130+
cir::IntType getUIntNTy(int n) {
131+
return cir::IntType::get(getContext(), n, false);
132+
}
133+
134+
cir::IntType getSIntNTy(int n) {
135+
return cir::IntType::get(getContext(), n, true);
136+
}
137+
130138
cir::PointerType getPointerTo(mlir::Type ty) {
131139
return cir::PointerType::get(ty);
132140
}

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,49 @@ def CIR_TypeInfoAttr : CIR_Attr<"TypeInfo", "typeinfo", [TypedAttrInterface]> {
967967
`<` custom<RecordMembers>($data) `>`
968968
}];
969969
}
970+
//===----------------------------------------------------------------------===//
971+
// InlineAttr
972+
//===----------------------------------------------------------------------===//
973+
974+
def CIR_InlineKind : CIR_I32EnumAttr<"InlineKind", "inlineKind", [
975+
I32EnumAttrCase<"NoInline", 1, "never">,
976+
I32EnumAttrCase<"AlwaysInline", 2, "always">,
977+
I32EnumAttrCase<"InlineHint", 3, "hint">
978+
]> {
979+
let genSpecializedAttr = 0;
980+
}
981+
982+
def CIR_InlineAttr : CIR_EnumAttr<CIR_InlineKind, "inline"> {
983+
let summary = "Inline attribute";
984+
let description = [{
985+
Inline attribute represents user directives for inlining behavior.
986+
This attribute is only used by `cir.func` operations.
987+
988+
Values:
989+
- `never`: Prevents the function from being inlined (__attribute__((noinline)))
990+
- `always`: Forces the function to be inlined (__attribute__((always_inline)))
991+
- `hint`: Suggests the function should be inlined (inline keyword)
992+
993+
Example:
994+
```
995+
cir.func @noinline_func(%arg0: !s32i) -> !s32i inline(never) {
996+
cir.return %arg0 : !s32i
997+
}
998+
cir.func @always_inline_func() -> !s32i inline(always) {
999+
%0 = cir.const #cir.int<42> : !s32i
1000+
cir.return %0 : !s32i
1001+
}
1002+
```
1003+
}];
1004+
1005+
let cppClassName = "InlineAttr";
1006+
1007+
let extraClassDeclaration = [{
1008+
bool isNoInline() const { return getValue() == InlineKind::NoInline; };
1009+
bool isAlwaysInline() const { return getValue() == InlineKind::AlwaysInline; };
1010+
bool isInlineHint() const { return getValue() == InlineKind::InlineHint; };
1011+
}];
1012+
}
9701013

9711014
//===----------------------------------------------------------------------===//
9721015
// CatchAllAttr & UnwindAttr

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,6 +2476,10 @@ def CIR_FuncOp : CIR_Op<"func", [
24762476
Similarly, for global destructors both `global_dtor` and
24772477
`global_dtor(<priority>)` are available.
24782478

2479+
The `inline(never)` keyword marks a function that should not be inlined.
2480+
The `inline(always)` keyword marks a function that should always be inlined.
2481+
The `inline(hint)` keyword suggests that the function should be inlined.
2482+
24792483
Example:
24802484

24812485
```mlir
@@ -2510,6 +2514,7 @@ def CIR_FuncOp : CIR_Op<"func", [
25102514
UnitAttr:$dso_local,
25112515
DefaultValuedAttr<CIR_GlobalLinkageKind,
25122516
"cir::GlobalLinkageKind::ExternalLinkage">:$linkage,
2517+
OptionalAttr<CIR_InlineAttr>:$inline_kind,
25132518
OptionalAttr<StrAttr>:$sym_visibility,
25142519
UnitAttr:$comdat,
25152520
OptionalAttr<DictArrayAttr>:$arg_attrs,

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,31 @@ struct MissingFeatures {
6969
static bool opAllocaCaptureByInit() { return false; }
7070

7171
// FuncOp handling
72-
static bool opFuncOpenCLKernelMetadata() { return false; }
72+
static bool opFuncArmNewAttr() { return false; }
73+
static bool opFuncArmStreamingAttr() { return false; }
7374
static bool opFuncAstDeclAttr() { return false; }
74-
static bool opFuncAttributesForDefinition() { return false; }
7575
static bool opFuncCallingConv() { return false; }
76+
static bool opFuncColdHotAttr() { return false; }
7677
static bool opFuncCPUAndFeaturesAttributes() { return false; }
7778
static bool opFuncExceptions() { return false; }
7879
static bool opFuncExtraAttrs() { return false; }
7980
static bool opFuncMaybeHandleStaticInExternC() { return false; }
81+
static bool opFuncMinSizeAttr() { return false; }
8082
static bool opFuncMultipleReturnVals() { return false; }
83+
static bool opFuncNakedAttr() { return false; }
84+
static bool opFuncNoDuplicateAttr() { return false; }
8185
static bool opFuncNoUnwind() { return false; }
86+
static bool opFuncOpenCLKernelMetadata() { return false; }
8287
static bool opFuncOperandBundles() { return false; }
88+
static bool opFuncOptNoneAttr() { return false; }
8389
static bool opFuncParameterAttributes() { return false; }
8490
static bool opFuncReadOnly() { return false; }
8591
static bool opFuncSection() { return false; }
92+
static bool opFuncUnwindTablesAttr() { return false; }
8693
static bool opFuncWillReturn() { return false; }
8794
static bool opFuncNoReturn() { return false; }
88-
static bool setLLVMFunctionFEnvAttributes() { return false; }
8995
static bool setFunctionAttributes() { return false; }
96+
static bool setLLVMFunctionFEnvAttributes() { return false; }
9097

9198
// CallOp handling
9299
static bool opCallAggregateArgs() { return false; }
@@ -271,6 +278,7 @@ struct MissingFeatures {
271278
static bool objCBlocks() { return false; }
272279
static bool objCGC() { return false; }
273280
static bool objCLifetime() { return false; }
281+
static bool hlsl() { return false; }
274282
static bool openCL() { return false; }
275283
static bool openMP() { return false; }
276284
static bool opTBAA() { return false; }
@@ -288,6 +296,7 @@ struct MissingFeatures {
288296
static bool sourceLanguageCases() { return false; }
289297
static bool stackBase() { return false; }
290298
static bool stackSaveOp() { return false; }
299+
static bool stackProtector() { return false; }
291300
static bool targetCIRGenInfoArch() { return false; }
292301
static bool targetCIRGenInfoOS() { return false; }
293302
static bool targetCodeGenInfoGetNullPointer() { return false; }

clang/include/clang/Sema/Sema.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13385,6 +13385,13 @@ class Sema final : public SemaBase {
1338513385
const MultiLevelTemplateArgumentList &TemplateArgs,
1338613386
TemplateArgumentListInfo &Outputs);
1338713387

13388+
/// Substitute concept template arguments in the constraint expression
13389+
/// of a concept-id. This is used to implement [temp.constr.normal].
13390+
ExprResult
13391+
SubstConceptTemplateArguments(const ConceptSpecializationExpr *CSE,
13392+
const Expr *ConstraintExpr,
13393+
const MultiLevelTemplateArgumentList &MLTAL);
13394+
1338813395
bool SubstTemplateArgumentsInParameterMapping(
1338913396
ArrayRef<TemplateArgumentLoc> Args, SourceLocation BaseLoc,
1339013397
const MultiLevelTemplateArgumentList &TemplateArgs,

clang/lib/AST/ByteCode/InterpBlock.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@ bool Block::hasPointer(const Pointer *P) const {
100100
}
101101
#endif
102102

103+
void Block::movePointersTo(Block *B) {
104+
assert(B != this);
105+
106+
while (Pointers) {
107+
Pointer *P = Pointers;
108+
109+
this->removePointer(P);
110+
P->BS.Pointee = B;
111+
B->addPointer(P);
112+
}
113+
assert(!this->hasPointers());
114+
}
115+
103116
DeadBlock::DeadBlock(DeadBlock *&Root, Block *Blk)
104117
: Root(Root), B(~0u, Blk->Desc, Blk->isExtern(), Blk->IsStatic,
105118
Blk->isWeak(), Blk->isDummy(), /*IsDead=*/true) {

0 commit comments

Comments
 (0)