Skip to content

Commit f9b3933

Browse files
committed
Merge branch 'main' into vector_multi_reduction_distr_refactor
2 parents 2ebe31e + 55e99ef commit f9b3933

File tree

712 files changed

+133638
-17757
lines changed

Some content is hidden

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

712 files changed

+133638
-17757
lines changed

.ci/all_requirements.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ ml-dtypes==0.5.1 ; python_version < "3.13" \
194194
--hash=sha256:d13755f8e8445b3870114e5b6240facaa7cb0c3361e54beba3e07fa912a6e12b \
195195
--hash=sha256:fd918d4e6a4e0c110e2e05be7a7814d10dc1b95872accbf6512b80a109b71ae1
196196
# via -r mlir/python/requirements.txt
197-
nanobind==2.9.2 \
198-
--hash=sha256:c37957ffd5eac7eda349cff3622ecd32e5ee1244ecc912c99b5bc8188bafd16e \
199-
--hash=sha256:e7608472de99d375759814cab3e2c94aba3f9ec80e62cfef8ced495ca5c27d6e
197+
nanobind==2.7.0 \
198+
--hash=sha256:73b12d0e751d140d6c1bf4b215e18818a8debfdb374f08dc3776ad208d808e74 \
199+
--hash=sha256:f9f1b160580c50dcf37b6495a0fd5ec61dc0d95dae5f8004f87dd9ad7eb46b34
200200
# via -r mlir/python/requirements.txt
201201
numpy==2.0.2 \
202202
--hash=sha256:0123ffdaa88fa4ab64835dcbde75dcdf89c453c922f18dced6e27c90d1d0ec5a \
@@ -383,10 +383,6 @@ swig==4.3.1 \
383383
--hash=sha256:efec16327029f682f649a26da726bb0305be8800bd0f1fa3e81bf0769cf5b476 \
384384
--hash=sha256:fc496c0d600cf1bb2d91e28d3d6eae9c4301e5ea7a0dec5a4281b5efed4245a8
385385
# via -r lldb/test/requirements.txt
386-
typing-extensions==4.15.0 \
387-
--hash=sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466 \
388-
--hash=sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548
389-
# via -r mlir/python/requirements.txt
390386
urllib3==2.5.0 \
391387
--hash=sha256:3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbff92760 \
392388
--hash=sha256:e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc

.github/new-prs-labeler.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,14 @@ clang:openmp:
10901090
- llvm/unittests/Frontend/OpenMP*
10911091
- llvm/test/Transforms/OpenMP/**
10921092

1093+
clang:temporal-safety:
1094+
- clang/include/clang/Analysis/Analyses/LifetimeSafety*
1095+
- clang/lib/Analysis/LifetimeSafety*
1096+
- clang/unittests/Analysis/LifetimeSafety*
1097+
- clang/test/Sema/*lifetime-safety*
1098+
- clang/test/Sema/*lifetime-analysis*
1099+
- clang/test/Analysis/LifetimeSafety/**
1100+
10931101
clang:as-a-library:
10941102
- clang/tools/libclang/**
10951103
- clang/bindings/**

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,21 +2517,17 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
25172517
createInstrIncMemory(const MCSymbol *Target, MCContext *Ctx, bool IsLeaf,
25182518
unsigned CodePointerSize) const override {
25192519
unsigned int I = 0;
2520-
InstructionListType Instrs(10);
2520+
InstructionListType Instrs(6);
25212521

25222522
createPushRegisters(Instrs[I++], AArch64::X0, AArch64::X1);
2523-
getSystemFlag(Instrs[I++], AArch64::X1);
25242523
InstructionListType Addr = materializeAddress(Target, Ctx, AArch64::X0);
25252524
assert(Addr.size() == 2 && "Invalid Addr size");
25262525
std::copy(Addr.begin(), Addr.end(), Instrs.begin() + I);
25272526
I += Addr.size();
2528-
storeReg(Instrs[I++], AArch64::X2, AArch64::SP);
2529-
InstructionListType Insts = createIncMemory(AArch64::X0, AArch64::X2);
2527+
InstructionListType Insts = createIncMemory(AArch64::X0, AArch64::X1);
25302528
assert(Insts.size() == 2 && "Invalid Insts size");
25312529
std::copy(Insts.begin(), Insts.end(), Instrs.begin() + I);
25322530
I += Insts.size();
2533-
loadReg(Instrs[I++], AArch64::X2, AArch64::SP);
2534-
setSystemFlag(Instrs[I++], AArch64::X1);
25352531
createPopRegisters(Instrs[I++], AArch64::X0, AArch64::X1);
25362532
return Instrs;
25372533
}

clang-tools-extra/clang-tidy/google/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ add_clang_library(clangTidyGoogleModule STATIC
1111
DefaultArgumentsCheck.cpp
1212
ExplicitConstructorCheck.cpp
1313
ExplicitMakePairCheck.cpp
14+
FloatTypesCheck.cpp
1415
FunctionNamingCheck.cpp
1516
GlobalNamesInHeadersCheck.cpp
1617
GlobalVariableDeclarationCheck.cpp
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "FloatTypesCheck.h"
10+
#include "clang/ASTMatchers/ASTMatchFinder.h"
11+
#include "clang/Lex/Lexer.h"
12+
13+
namespace clang {
14+
15+
using namespace ast_matchers;
16+
17+
namespace {
18+
19+
AST_POLYMORPHIC_MATCHER(isValidAndNotInMacro,
20+
AST_POLYMORPHIC_SUPPORTED_TYPES(TypeLoc,
21+
FloatingLiteral)) {
22+
const SourceLocation Loc = Node.getBeginLoc();
23+
return Loc.isValid() && !Loc.isMacroID();
24+
}
25+
26+
AST_MATCHER(TypeLoc, isLongDoubleType) {
27+
TypeLoc TL = Node;
28+
if (const auto QualLoc = Node.getAs<QualifiedTypeLoc>())
29+
TL = QualLoc.getUnqualifiedLoc();
30+
31+
const auto BuiltinLoc = TL.getAs<BuiltinTypeLoc>();
32+
if (!BuiltinLoc)
33+
return false;
34+
35+
if (const auto *BT = BuiltinLoc.getTypePtr())
36+
return BT->getKind() == BuiltinType::LongDouble;
37+
return false;
38+
}
39+
40+
AST_MATCHER(FloatingLiteral, isLongDoubleLiteral) {
41+
if (const auto *BT =
42+
dyn_cast_if_present<BuiltinType>(Node.getType().getTypePtr()))
43+
return BT->getKind() == BuiltinType::LongDouble;
44+
return false;
45+
}
46+
47+
} // namespace
48+
49+
namespace tidy::google::runtime {
50+
51+
void RuntimeFloatCheck::registerMatchers(MatchFinder *Finder) {
52+
Finder->addMatcher(typeLoc(loc(realFloatingPointType()),
53+
isValidAndNotInMacro(), isLongDoubleType())
54+
.bind("longDoubleTypeLoc"),
55+
this);
56+
Finder->addMatcher(floatLiteral(isValidAndNotInMacro(), isLongDoubleLiteral())
57+
.bind("longDoubleFloatLiteral"),
58+
this);
59+
}
60+
61+
void RuntimeFloatCheck::check(const MatchFinder::MatchResult &Result) {
62+
if (const auto *TL = Result.Nodes.getNodeAs<TypeLoc>("longDoubleTypeLoc")) {
63+
diag(TL->getBeginLoc(), "%0 type is not portable and should not be used")
64+
<< TL->getType();
65+
}
66+
67+
if (const auto *FL =
68+
Result.Nodes.getNodeAs<FloatingLiteral>("longDoubleFloatLiteral")) {
69+
diag(FL->getBeginLoc(), "%0 type from literal suffix 'L' is not portable "
70+
"and should not be used")
71+
<< FL->getType();
72+
}
73+
}
74+
75+
} // namespace tidy::google::runtime
76+
77+
} // namespace clang
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_FLOATTYPESCHECK_H
10+
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_FLOATTYPESCHECK_H
11+
12+
#include "../ClangTidyCheck.h"
13+
14+
namespace clang::tidy::google::runtime {
15+
16+
/// Finds usages of `long double` and suggests against their use due to lack
17+
/// of portability.
18+
///
19+
/// For the user-facing documentation see:
20+
/// http://clang.llvm.org/extra/clang-tidy/checks/google/runtime-float.html
21+
class RuntimeFloatCheck : public ClangTidyCheck {
22+
public:
23+
RuntimeFloatCheck(StringRef Name, ClangTidyContext *Context)
24+
: ClangTidyCheck(Name, Context) {}
25+
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
26+
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
27+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
28+
return LangOpts.CPlusPlus && !LangOpts.ObjC;
29+
}
30+
};
31+
32+
} // namespace clang::tidy::google::runtime
33+
34+
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_FLOATTYPESCHECK_H

clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "DefaultArgumentsCheck.h"
2020
#include "ExplicitConstructorCheck.h"
2121
#include "ExplicitMakePairCheck.h"
22+
#include "FloatTypesCheck.h"
2223
#include "FunctionNamingCheck.h"
2324
#include "GlobalNamesInHeadersCheck.h"
2425
#include "GlobalVariableDeclarationCheck.h"
@@ -57,6 +58,8 @@ class GoogleModule : public ClangTidyModule {
5758
"google-objc-function-naming");
5859
CheckFactories.registerCheck<objc::GlobalVariableDeclarationCheck>(
5960
"google-objc-global-variable-declaration");
61+
CheckFactories.registerCheck<runtime::RuntimeFloatCheck>(
62+
"google-runtime-float");
6063
CheckFactories.registerCheck<runtime::IntegerTypesCheck>(
6164
"google-runtime-int");
6265
CheckFactories.registerCheck<runtime::OverloadedUnaryAndCheck>(

clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace {
3939
// - LoopCounterName: The entire for loop (as ForStmt).
4040
// - LoopParentName: The body of function f (as CompoundStmt).
4141
// - VectorVarDeclName: 'v' (as VarDecl).
42-
// - VectorVarDeclStmatName: The entire 'std::vector<T> v;' statement (as
42+
// - VectorVarDeclStmtName: The entire 'std::vector<T> v;' statement (as
4343
// DeclStmt).
4444
// - PushBackOrEmplaceBackCallName: 'v.push_back(i)' (as cxxMemberCallExpr).
4545
// - LoopInitVarName: 'i' (as VarDecl).

clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static StringRef const StyleNames[] = {
186186
m(ptrdiff_t) \
187187
m(void) \
188188

189-
static StringRef const HungarainNotationPrimitiveTypes[] = {
189+
static StringRef const HungarianNotationPrimitiveTypes[] = {
190190
#define STRINGIZE(v) #v,
191191
HUNGARIAN_NOTATION_PRIMITIVE_TYPES(STRINGIZE)
192192
#undef STRINGIZE
@@ -222,7 +222,7 @@ static StringRef const HungarainNotationPrimitiveTypes[] = {
222222
m(UINT64) \
223223
m(PVOID) \
224224

225-
static StringRef const HungarainNotationUserDefinedTypes[] = {
225+
static StringRef const HungarianNotationUserDefinedTypes[] = {
226226
#define STRINGIZE(v) #v,
227227
HUNGARIAN_NOTATION_USER_DEFINED_TYPES(STRINGIZE)
228228
#undef STRINGIZE
@@ -488,7 +488,7 @@ void IdentifierNamingCheck::HungarianNotation::loadFileConfig(
488488

489489
Buffer = {Section, "PrimitiveType."};
490490
DefSize = Buffer.size();
491-
for (const auto &PrimType : HungarainNotationPrimitiveTypes) {
491+
for (const auto &PrimType : HungarianNotationPrimitiveTypes) {
492492
Buffer.truncate(DefSize);
493493
Buffer.append(PrimType);
494494
StringRef Val = Options.get(Buffer, "");
@@ -501,7 +501,7 @@ void IdentifierNamingCheck::HungarianNotation::loadFileConfig(
501501

502502
Buffer = {Section, "UserDefinedType."};
503503
DefSize = Buffer.size();
504-
for (const auto &Type : HungarainNotationUserDefinedTypes) {
504+
for (const auto &Type : HungarianNotationUserDefinedTypes) {
505505
Buffer.truncate(DefSize);
506506
Buffer.append(Type);
507507
StringRef Val = Options.get(Buffer, "");

clang-tools-extra/clang-tidy/readability/MathMissingParenthesesCheck.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static int getPrecedence(const BinaryOperator *BinOp) {
4848
return 0;
4949
}
5050
}
51-
static void addParantheses(const BinaryOperator *BinOp,
51+
static void addParentheses(const BinaryOperator *BinOp,
5252
const BinaryOperator *ParentBinOp,
5353
ClangTidyCheck *Check,
5454
const clang::SourceManager &SM,
@@ -81,9 +81,9 @@ static void addParantheses(const BinaryOperator *BinOp,
8181
}
8282
}
8383

84-
addParantheses(dyn_cast<BinaryOperator>(BinOp->getLHS()->IgnoreImpCasts()),
84+
addParentheses(dyn_cast<BinaryOperator>(BinOp->getLHS()->IgnoreImpCasts()),
8585
BinOp, Check, SM, LangOpts);
86-
addParantheses(dyn_cast<BinaryOperator>(BinOp->getRHS()->IgnoreImpCasts()),
86+
addParentheses(dyn_cast<BinaryOperator>(BinOp->getRHS()->IgnoreImpCasts()),
8787
BinOp, Check, SM, LangOpts);
8888
}
8989

@@ -92,7 +92,7 @@ void MathMissingParenthesesCheck::check(
9292
const auto *BinOp = Result.Nodes.getNodeAs<BinaryOperator>("binOp");
9393
const SourceManager &SM = *Result.SourceManager;
9494
const clang::LangOptions &LO = Result.Context->getLangOpts();
95-
addParantheses(BinOp, nullptr, this, SM, LO);
95+
addParentheses(BinOp, nullptr, this, SM, LO);
9696
}
9797

9898
} // namespace clang::tidy::readability

0 commit comments

Comments
 (0)