Skip to content

Commit 5eb1b77

Browse files
authored
Merge branch 'main' into users/kparzysz/r06-unparse-noeol
2 parents 84d457f + a4168a6 commit 5eb1b77

File tree

150 files changed

+2787
-863
lines changed

Some content is hidden

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

150 files changed

+2787
-863
lines changed

.github/renovate.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended"
5+
],
6+
"includePaths": [".github/**"],
7+
"schedule": "* 0 * * 1",
8+
"minimumReleaseAge": "3 days",
9+
"assignees": ["boomanaiden154"],
10+
"ignorePaths": [".github/workflows/containers/**"],
11+
"groupName": "[Github] Update GHA Dependencies"
12+
}

clang/include/clang/Analysis/FlowSensitive/CachedConstAccessorsLattice.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ template <typename Base> class CachedConstAccessorsLattice : public Base {
9090
return Base::operator==(Other);
9191
}
9292

93-
LatticeJoinEffect join(const CachedConstAccessorsLattice &Other);
93+
LatticeEffect join(const CachedConstAccessorsLattice &Other);
9494

9595
private:
9696
// Maps a record storage location and const method to the value to return
@@ -121,21 +121,22 @@ joinConstMethodMap(
121121
llvm::SmallDenseMap<const FunctionDecl *, T *>>
122122
&Map2,
123123
LatticeEffect &Effect) {
124+
// Intersect the two maps, and note if change was made.
124125
llvm::SmallDenseMap<const RecordStorageLocation *,
125126
llvm::SmallDenseMap<const FunctionDecl *, T *>>
126127
Result;
127128
for (auto &[Loc, DeclToT] : Map1) {
128129
auto It = Map2.find(Loc);
129130
if (It == Map2.end()) {
130-
Effect = LatticeJoinEffect::Changed;
131+
Effect = LatticeEffect::Changed;
131132
continue;
132133
}
133134
const auto &OtherDeclToT = It->second;
134135
auto &JoinedDeclToT = Result[Loc];
135136
for (auto [Func, Var] : DeclToT) {
136137
T *OtherVar = OtherDeclToT.lookup(Func);
137138
if (OtherVar == nullptr || OtherVar != Var) {
138-
Effect = LatticeJoinEffect::Changed;
139+
Effect = LatticeEffect::Changed;
139140
continue;
140141
}
141142
JoinedDeclToT.insert({Func, Var});

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ struct MissingFeatures {
214214
static bool ehCleanupScopeRequiresEHCleanup() { return false; }
215215
static bool ehCleanupBranchFixups() { return false; }
216216
static bool ehstackBranches() { return false; }
217+
static bool emitBranchThroughCleanup() { return false; }
217218
static bool emitCheckedInBoundsGEP() { return false; }
218219
static bool emitCondLikelihoodViaExpectIntrinsic() { return false; }
219220
static bool emitLifetimeMarkers() { return false; }

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4587,7 +4587,7 @@ defm ptrauth_block_descriptor_pointers : OptInCC1FFlag<"ptrauth-block-descriptor
45874587
def fenable_matrix : Flag<["-"], "fenable-matrix">, Group<f_Group>,
45884588
Visibility<[ClangOption, CC1Option]>,
45894589
HelpText<"Enable matrix data type and related builtin functions">,
4590-
MarshallingInfoFlag<LangOpts<"MatrixTypes">>;
4590+
MarshallingInfoFlag<LangOpts<"MatrixTypes">, hlsl.KeyPath>;
45914591

45924592
defm raw_string_literals : BoolFOption<"raw-string-literals",
45934593
LangOpts<"RawStringLiterals">, Default<std#".hasRawStringLiterals()">,

clang/include/clang/Sema/HLSLExternalSemaSource.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class HLSLExternalSemaSource : public ExternalSemaSource {
4444
private:
4545
void defineTrivialHLSLTypes();
4646
void defineHLSLVectorAlias();
47+
void defineHLSLMatrixAlias();
4748
void defineHLSLTypesWithForwardDeclarations();
4849
void onCompletion(CXXRecordDecl *Record, CompletionFunction Fn);
4950
};

clang/include/clang/Tooling/Refactoring/RefactoringOptionVisitor.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ namespace internal {
3737
template <typename T> struct HasHandle {
3838
private:
3939
template <typename ClassT>
40-
static auto check(ClassT *) -> typename std::is_same<
41-
decltype(std::declval<RefactoringOptionVisitor>().visit(
42-
std::declval<RefactoringOption>(),
43-
*std::declval<std::optional<T> *>())),
44-
void>::type;
40+
static auto check(ClassT *)
41+
-> std::is_same<decltype(std::declval<RefactoringOptionVisitor>().visit(
42+
std::declval<RefactoringOption>(),
43+
*std::declval<std::optional<T> *>())),
44+
void>;
4545

4646
template <typename> static std::false_type check(...);
4747

clang/lib/AST/ByteCode/Context.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ bool Context::evaluateStrlen(State &Parent, const Expr *E, uint64_t &Result) {
245245
if (!FieldDesc->isPrimitiveArray())
246246
return false;
247247

248+
if (Ptr.isDummy() || Ptr.isUnknownSizeArray())
249+
return false;
250+
248251
unsigned N = Ptr.getNumElems();
249252
if (Ptr.elemSize() == 1) {
250253
Result = strnlen(reinterpret_cast<const char *>(Ptr.getRawAddress()), N);

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -666,16 +666,6 @@ static bool interp__builtin_abs(InterpState &S, CodePtr OpPC,
666666
return true;
667667
}
668668

669-
static bool interp__builtin_knot(InterpState &S, CodePtr OpPC,
670-
const InterpFrame *Frame,
671-
const CallExpr *Call) {
672-
APSInt Val =
673-
popToAPSInt(S.Stk, *S.getContext().classify(Call->getArg(0)->getType()));
674-
APInt Result = ~Val;
675-
pushInteger(S, APSInt(std::move(Result), true), Call->getType());
676-
return true;
677-
}
678-
679669
static bool interp__builtin_popcount(InterpState &S, CodePtr OpPC,
680670
const InterpFrame *Frame,
681671
const CallExpr *Call) {
@@ -1380,32 +1370,6 @@ static bool interp__builtin_ia32_bzhi(InterpState &S, CodePtr OpPC,
13801370
return true;
13811371
}
13821372

1383-
static bool interp__builtin_ia32_lzcnt(InterpState &S, CodePtr OpPC,
1384-
const InterpFrame *Frame,
1385-
const CallExpr *Call) {
1386-
QualType CallType = Call->getType();
1387-
if (!CallType->isIntegerType() ||
1388-
!Call->getArg(0)->getType()->isIntegerType())
1389-
return false;
1390-
1391-
APSInt Val = popToAPSInt(S, Call->getArg(0));
1392-
pushInteger(S, Val.countLeadingZeros(), CallType);
1393-
return true;
1394-
}
1395-
1396-
static bool interp__builtin_ia32_tzcnt(InterpState &S, CodePtr OpPC,
1397-
const InterpFrame *Frame,
1398-
const CallExpr *Call) {
1399-
QualType CallType = Call->getType();
1400-
if (!CallType->isIntegerType() ||
1401-
!Call->getArg(0)->getType()->isIntegerType())
1402-
return false;
1403-
1404-
APSInt Val = popToAPSInt(S, Call->getArg(0));
1405-
pushInteger(S, Val.countTrailingZeros(), CallType);
1406-
return true;
1407-
}
1408-
14091373
static bool interp__builtin_ia32_pdep(InterpState &S, CodePtr OpPC,
14101374
const InterpFrame *Frame,
14111375
const CallExpr *Call) {
@@ -2551,6 +2515,24 @@ static bool interp__builtin_is_within_lifetime(InterpState &S, CodePtr OpPC,
25512515
return true;
25522516
}
25532517

2518+
static bool interp__builtin_elementwise_int_unaryop(
2519+
InterpState &S, CodePtr OpPC, const CallExpr *Call,
2520+
llvm::function_ref<APInt(const APSInt &)> Fn) {
2521+
assert(Call->getNumArgs() == 1);
2522+
assert(Call->getType()->isIntegerType());
2523+
2524+
// Single integer case.
2525+
if (!Call->getArg(0)->getType()->isVectorType()) {
2526+
APSInt Src = popToAPSInt(S, Call->getArg(0));
2527+
APInt Result = Fn(Src);
2528+
pushInteger(S, APSInt(std::move(Result), !Src.isSigned()), Call->getType());
2529+
return true;
2530+
}
2531+
2532+
// TODO: Add vector integer handling.
2533+
return false;
2534+
}
2535+
25542536
static bool interp__builtin_elementwise_int_binop(
25552537
InterpState &S, CodePtr OpPC, const CallExpr *Call,
25562538
llvm::function_ref<APInt(const APSInt &, const APSInt &)> Fn) {
@@ -3283,12 +3265,18 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
32833265
case clang::X86::BI__builtin_ia32_lzcnt_u16:
32843266
case clang::X86::BI__builtin_ia32_lzcnt_u32:
32853267
case clang::X86::BI__builtin_ia32_lzcnt_u64:
3286-
return interp__builtin_ia32_lzcnt(S, OpPC, Frame, Call);
3268+
return interp__builtin_elementwise_int_unaryop(
3269+
S, OpPC, Call, [](const APSInt &Src) {
3270+
return APInt(Src.getBitWidth(), Src.countLeadingZeros());
3271+
});
32873272

32883273
case clang::X86::BI__builtin_ia32_tzcnt_u16:
32893274
case clang::X86::BI__builtin_ia32_tzcnt_u32:
32903275
case clang::X86::BI__builtin_ia32_tzcnt_u64:
3291-
return interp__builtin_ia32_tzcnt(S, OpPC, Frame, Call);
3276+
return interp__builtin_elementwise_int_unaryop(
3277+
S, OpPC, Call, [](const APSInt &Src) {
3278+
return APInt(Src.getBitWidth(), Src.countTrailingZeros());
3279+
});
32923280

32933281
case clang::X86::BI__builtin_ia32_pdep_si:
32943282
case clang::X86::BI__builtin_ia32_pdep_di:
@@ -3661,7 +3649,8 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
36613649
case X86::BI__builtin_ia32_knothi:
36623650
case X86::BI__builtin_ia32_knotsi:
36633651
case X86::BI__builtin_ia32_knotdi:
3664-
return interp__builtin_knot(S, OpPC, Frame, Call);
3652+
return interp__builtin_elementwise_int_unaryop(
3653+
S, OpPC, Call, [](const APSInt &Src) { return ~Src; });
36653654

36663655
case X86::BI__builtin_ia32_kaddqi:
36673656
case X86::BI__builtin_ia32_kaddhi:

clang/lib/AST/TypePrinter.cpp

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -846,16 +846,45 @@ void TypePrinter::printExtVectorAfter(const ExtVectorType *T, raw_ostream &OS) {
846846
}
847847
}
848848

849-
void TypePrinter::printConstantMatrixBefore(const ConstantMatrixType *T,
850-
raw_ostream &OS) {
851-
printBefore(T->getElementType(), OS);
852-
OS << " __attribute__((matrix_type(";
849+
static void printDims(const ConstantMatrixType *T, raw_ostream &OS) {
853850
OS << T->getNumRows() << ", " << T->getNumColumns();
851+
}
852+
853+
static void printHLSLMatrixBefore(TypePrinter &TP, const ConstantMatrixType *T,
854+
raw_ostream &OS) {
855+
OS << "matrix<";
856+
TP.printBefore(T->getElementType(), OS);
857+
}
858+
859+
static void printHLSLMatrixAfter(const ConstantMatrixType *T, raw_ostream &OS) {
860+
OS << ", ";
861+
printDims(T, OS);
862+
OS << ">";
863+
}
864+
865+
static void printClangMatrixBefore(TypePrinter &TP, const ConstantMatrixType *T,
866+
raw_ostream &OS) {
867+
TP.printBefore(T->getElementType(), OS);
868+
OS << " __attribute__((matrix_type(";
869+
printDims(T, OS);
854870
OS << ")))";
855871
}
856872

873+
void TypePrinter::printConstantMatrixBefore(const ConstantMatrixType *T,
874+
raw_ostream &OS) {
875+
if (Policy.UseHLSLTypes) {
876+
printHLSLMatrixBefore(*this, T, OS);
877+
return;
878+
}
879+
printClangMatrixBefore(*this, T, OS);
880+
}
881+
857882
void TypePrinter::printConstantMatrixAfter(const ConstantMatrixType *T,
858883
raw_ostream &OS) {
884+
if (Policy.UseHLSLTypes) {
885+
printHLSLMatrixAfter(T, OS);
886+
return;
887+
}
859888
printAfter(T->getElementType(), OS);
860889
}
861890

clang/lib/CIR/CodeGen/CIRGenCall.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ class ReturnValueSlot {
256256
ReturnValueSlot() = default;
257257
ReturnValueSlot(Address addr) : addr(addr) {}
258258

259+
bool isNull() const { return !addr.isValid(); }
259260
Address getValue() const { return addr; }
260261
};
261262

0 commit comments

Comments
 (0)