Skip to content

Commit c0595fb

Browse files
authored
Merge branch 'main' into tablegen/ppc-mem-operands
2 parents 8acf305 + ffa45f2 commit c0595fb

File tree

813 files changed

+19256
-6930
lines changed

Some content is hidden

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

813 files changed

+19256
-6930
lines changed

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2580,6 +2580,7 @@ struct CFISnapshot {
25802580
case MCCFIInstruction::OpNegateRAStateWithPC:
25812581
case MCCFIInstruction::OpLLVMDefAspaceCfa:
25822582
case MCCFIInstruction::OpLabel:
2583+
case MCCFIInstruction::OpValOffset:
25832584
llvm_unreachable("unsupported CFI opcode");
25842585
break;
25852586
case MCCFIInstruction::OpRememberState:
@@ -2719,6 +2720,7 @@ struct CFISnapshotDiff : public CFISnapshot {
27192720
case MCCFIInstruction::OpNegateRAStateWithPC:
27202721
case MCCFIInstruction::OpLLVMDefAspaceCfa:
27212722
case MCCFIInstruction::OpLabel:
2723+
case MCCFIInstruction::OpValOffset:
27222724
llvm_unreachable("unsupported CFI opcode");
27232725
return false;
27242726
case MCCFIInstruction::OpRememberState:
@@ -2869,6 +2871,7 @@ BinaryFunction::unwindCFIState(int32_t FromState, int32_t ToState,
28692871
case MCCFIInstruction::OpNegateRAStateWithPC:
28702872
case MCCFIInstruction::OpLLVMDefAspaceCfa:
28712873
case MCCFIInstruction::OpLabel:
2874+
case MCCFIInstruction::OpValOffset:
28722875
llvm_unreachable("unsupported CFI opcode");
28732876
break;
28742877
case MCCFIInstruction::OpGnuArgsSize:

clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) {
400400
"suspicious usage of 'sizeof(array)/sizeof(...)';"
401401
" denominator differs from the size of array elements")
402402
<< E->getLHS()->getSourceRange() << E->getRHS()->getSourceRange();
403-
} else if (NumTy && DenomTy && NumTy == DenomTy) {
403+
} else if (NumTy && DenomTy && NumTy == DenomTy &&
404+
!NumTy->isDependentType()) {
405+
// Dependent type should not be compared.
404406
diag(E->getOperatorLoc(),
405407
"suspicious usage of 'sizeof(...)/sizeof(...)'; both expressions "
406408
"have the same type")

clang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ using namespace clang::ast_matchers;
1515
namespace clang::tidy::bugprone {
1616

1717
void ThrowKeywordMissingCheck::registerMatchers(MatchFinder *Finder) {
18-
auto CtorInitializerList =
19-
cxxConstructorDecl(hasAnyConstructorInitializer(anything()));
20-
2118
Finder->addMatcher(
2219
cxxConstructExpr(
2320
hasType(cxxRecordDecl(
@@ -27,7 +24,7 @@ void ThrowKeywordMissingCheck::registerMatchers(MatchFinder *Finder) {
2724
stmt(anyOf(cxxThrowExpr(), callExpr(), returnStmt()))),
2825
hasAncestor(decl(anyOf(varDecl(), fieldDecl()))),
2926
hasAncestor(expr(cxxNewExpr(hasAnyPlacementArg(anything())))),
30-
allOf(hasAncestor(CtorInitializerList),
27+
allOf(hasAncestor(cxxConstructorDecl()),
3128
unless(hasAncestor(cxxCatchStmt()))))))
3229
.bind("temporary-exception-not-thrown"),
3330
this);

clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
#include "InitVariablesCheck.h"
1010

11+
#include "../utils/LexerUtils.h"
1112
#include "clang/AST/ASTContext.h"
13+
#include "clang/AST/Type.h"
1214
#include "clang/ASTMatchers/ASTMatchFinder.h"
13-
#include "clang/Lex/PPCallbacks.h"
1415
#include "clang/Lex/Preprocessor.h"
1516
#include <optional>
1617

@@ -107,8 +108,9 @@ void InitVariablesCheck::check(const MatchFinder::MatchResult &Result) {
107108
<< MatchedDecl;
108109
if (*InitializationString != nullptr)
109110
Diagnostic << FixItHint::CreateInsertion(
110-
MatchedDecl->getLocation().getLocWithOffset(
111-
MatchedDecl->getName().size()),
111+
utils::lexer::findNextTerminator(MatchedDecl->getLocation(),
112+
*Result.SourceManager,
113+
Result.Context->getLangOpts()),
112114
*InitializationString);
113115
if (AddMathInclude) {
114116
Diagnostic << IncludeInserter.createIncludeInsertion(

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,12 @@ Changes in existing checks
175175
- Improved :doc:`bugprone-sizeof-expression
176176
<clang-tidy/checks/bugprone/sizeof-expression>` check to find suspicious
177177
usages of ``sizeof()``, ``alignof()``, and ``offsetof()`` when adding or
178-
subtracting from a pointer directly or when used to scale a numeric value.
178+
subtracting from a pointer directly or when used to scale a numeric value and
179+
fix false positive when sizeof expression with template types.
180+
181+
- Improved :doc:`bugprone-throw-keyword-missing
182+
<clang-tidy/checks/bugprone/throw-keyword-missing>` by fixing a false positive
183+
when using non-static member initializers and a constructor.
179184

180185
- Improved :doc:`bugprone-unchecked-optional-access
181186
<clang-tidy/checks/bugprone/unchecked-optional-access>` to support
@@ -190,6 +195,10 @@ Changes in existing checks
190195
fix false positive that floating point variable is only used in increment
191196
expression.
192197

198+
- Improved :doc:`cppcoreguidelines-init-variables
199+
<clang-tidy/checks/cppcoreguidelines/init-variables>` check by fixing the
200+
insertion location for function pointers.
201+
193202
- Improved :doc:`cppcoreguidelines-prefer-member-initializer
194203
<clang-tidy/checks/cppcoreguidelines/prefer-member-initializer>` check to
195204
avoid false positive when member initialization depends on a structured
@@ -208,9 +217,9 @@ Changes in existing checks
208217
false positive for C++23 deducing this.
209218

210219
- Improved :doc:`modernize-avoid-c-arrays
211-
<clang-tidy/checks/modernize/avoid-c-arrays>` check to suggest using ``std::span``
212-
as a replacement for parameters of incomplete C array type in C++20 and
213-
``std::array`` or ``std::vector`` before C++20.
220+
<clang-tidy/checks/modernize/avoid-c-arrays>` check to suggest using
221+
``std::span`` as a replacement for parameters of incomplete C array type in
222+
C++20 and ``std::array`` or ``std::vector`` before C++20.
214223

215224
- Improved :doc:`modernize-loop-convert
216225
<clang-tidy/checks/modernize/loop-convert>` check to fix false positive when

clang-tools-extra/test/clang-tidy/checkers/bugprone/sizeof-expression.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,3 +385,10 @@ int ValidExpressions() {
385385
sum += sizeof(PtrArray) / sizeof(A[0]);
386386
return sum;
387387
}
388+
389+
namespace gh115175 {
390+
template<class T>
391+
int ValidateTemplateTypeExpressions(T t) {
392+
return sizeof(t.val) / sizeof(t.val[0]);
393+
}
394+
} // namespace gh115175

clang-tools-extra/test/clang-tidy/checkers/bugprone/throw-keyword-missing.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ CtorInitializerListTest::CtorInitializerListTest(float) try : exc(RegularExcepti
139139
RegularException();
140140
}
141141

142+
namespace GH115055 {
143+
class CtorInitializerListTest2 {
144+
public:
145+
CtorInitializerListTest2() {}
146+
private:
147+
RegularException exc{};
148+
};
149+
} // namespace GH115055
150+
142151
RegularException funcReturningExceptionTest(int i) {
143152
return RegularException();
144153
}

clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/init-variables.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,17 @@ void test_clang_diagnostic_error() {
134134
// CHECK-MESSAGES: :[[@LINE-1]]:3: error: unknown type name 'UnknownType' [clang-diagnostic-error]
135135
// CHECK-FIXES-NOT: {{^}} UnknownType b = 0;{{$}}
136136
}
137+
138+
namespace gh112089 {
139+
void foo(void*);
140+
using FPtr = void(*)(void*);
141+
void test() {
142+
void(*a1)(void*);
143+
// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: variable 'a1' is not initialized [cppcoreguidelines-init-variables]
144+
// CHECK-FIXES: void(*a1)(void*) = nullptr;
145+
FPtr a2;
146+
// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: variable 'a2' is not initialized [cppcoreguidelines-init-variables]
147+
// CHECK-FIXES: FPtr a2 = nullptr;
148+
}
149+
} // namespace gh112089
150+

clang/docs/AMDGPUSupport.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ Predefined Macros
5050
* - ``__AMDGCN_UNSAFE_FP_ATOMICS__``
5151
- Defined if unsafe floating-point atomics are allowed.
5252
* - ``__AMDGCN_WAVEFRONT_SIZE__``
53-
- Defines the wavefront size. Allowed values are 32 and 64.
53+
- Defines the wavefront size. Allowed values are 32 and 64 (deprecated).
5454
* - ``__AMDGCN_WAVEFRONT_SIZE``
55-
- Alias to ``__AMDGCN_WAVEFRONT_SIZE__``. To be deprecated.
55+
- Alias to ``__AMDGCN_WAVEFRONT_SIZE__`` (deprecated).
5656
* - ``__HAS_FMAF__``
5757
- Defined if FMAF instruction is available (deprecated).
5858
* - ``__HAS_LDEXPF__``

clang/docs/HIPSupport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Predefined Macros
178178

179179
Note that some architecture specific AMDGPU macros will have default values when
180180
used from the HIP host compilation. Other :doc:`AMDGPU macros <AMDGPUSupport>`
181-
like ``__AMDGCN_WAVEFRONT_SIZE__`` will default to 64 for example.
181+
like ``__AMDGCN_WAVEFRONT_SIZE__`` (deprecated) will default to 64 for example.
182182

183183
Compilation Modes
184184
=================

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,8 @@ Bug Fixes to C++ Support
652652
an implicitly instantiated class template specialization. (#GH51051)
653653
- Fixed an assertion failure caused by invalid enum forward declarations. (#GH112208)
654654
- Name independent data members were not correctly initialized from default member initializers. (#GH114069)
655+
- Fixed expression transformation for ``[[assume(...)]]``, allowing using pack indexing expressions within the
656+
assumption if they also occur inside of a dependent lambda. (#GH114787)
655657

656658
Bug Fixes to AST Handling
657659
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -739,6 +741,8 @@ X86 Support
739741
* Supported intrinsics of ``_mm(256|512)_(mask(z))_loadrs_epi(8|16|32|64)``.
740742
- Support ISA of ``AMX-FP8``.
741743
- Support ISA of ``AMX-TRANSPOSE``.
744+
- Support ISA of ``AMX-AVX512``.
745+
- Support ISA of ``AMX-TF32``.
742746

743747
Arm and AArch64 Support
744748
^^^^^^^^^^^^^^^^^^^^^^^

clang/docs/SafeBuffers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ A relatively fresh version of C++ is recommended. In particular, the very useful
5858
standard view class ``std::span`` requires C++20.
5959

6060
Other implementations of the C++ standard library may provide different
61-
flags to enable such hardening hardening.
61+
flags to enable such hardening.
6262

6363
If you're using custom containers and views, they will need to be hardened
6464
this way as well, but you don't necessarily need to do this ahead of time.

clang/include/clang/Basic/BuiltinsX86_64.def

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ TARGET_BUILTIN(__builtin_ia32_t2rpntlvwz0t1_internal, "vUsUsUsV256i*V256i*vC*z",
133133
TARGET_BUILTIN(__builtin_ia32_t2rpntlvwz1_internal, "vUsUsUsV256i*V256i*vC*z", "n", "amx-transpose")
134134
TARGET_BUILTIN(__builtin_ia32_t2rpntlvwz1t1_internal, "vUsUsUsV256i*V256i*vC*z", "n", "amx-transpose")
135135
TARGET_BUILTIN(__builtin_ia32_ttransposed_internal, "V256iUsUsV256i", "n", "amx-transpose")
136+
TARGET_BUILTIN(__builtin_ia32_tcvtrowd2ps_internal, "V16fUsUsV256iUi", "n", "amx-avx512,avx10.2-512")
137+
TARGET_BUILTIN(__builtin_ia32_tcvtrowps2pbf16h_internal, "V32yUsUsV256iUi", "n", "amx-avx512,avx10.2-512")
138+
TARGET_BUILTIN(__builtin_ia32_tcvtrowps2pbf16l_internal, "V32yUsUsV256iUi", "n", "amx-avx512,avx10.2-512")
139+
TARGET_BUILTIN(__builtin_ia32_tcvtrowps2phh_internal, "V32xUsUsV256iUi", "n", "amx-avx512,avx10.2-512")
140+
TARGET_BUILTIN(__builtin_ia32_tcvtrowps2phl_internal, "V32xUsUsV256iUi", "n", "amx-avx512,avx10.2-512")
141+
TARGET_BUILTIN(__builtin_ia32_tilemovrow_internal, "V16iUsUsV256iUi", "n", "amx-avx512,avx10.2-512")
142+
TARGET_BUILTIN(__builtin_ia32_tmmultf32ps_internal, "V256iUsUsUsV256iV256iV256i", "n", "amx-tf32")
143+
TARGET_BUILTIN(__builtin_ia32_ttmmultf32ps_internal, "V256iUsUsUsV256iV256iV256i", "n", "amx-tf32,amx-transpose")
144+
136145
// AMX
137146
TARGET_BUILTIN(__builtin_ia32_tile_loadconfig, "vvC*", "n", "amx-tile")
138147
TARGET_BUILTIN(__builtin_ia32_tile_storeconfig, "vvC*", "n", "amx-tile")
@@ -159,9 +168,12 @@ TARGET_BUILTIN(__builtin_ia32_t2rpntlvwz1, "vIUcvC*z", "n", "amx-transpose")
159168
TARGET_BUILTIN(__builtin_ia32_t2rpntlvwz1t1, "vIUcvC*z", "n","amx-transpose")
160169
TARGET_BUILTIN(__builtin_ia32_ttransposed, "vIUcIUc", "n", "amx-transpose")
161170

162-
TARGET_BUILTIN(__builtin_ia32_prefetchi, "vvC*Ui", "nc", "prefetchi")
163-
TARGET_BUILTIN(__builtin_ia32_cmpccxadd32, "Siv*SiSiIi", "n", "cmpccxadd")
164-
TARGET_BUILTIN(__builtin_ia32_cmpccxadd64, "SLLiSLLi*SLLiSLLiIi", "n", "cmpccxadd")
171+
TARGET_BUILTIN(__builtin_ia32_tcvtrowd2ps, "V16fIUcUi", "n", "amx-avx512,avx10.2-512")
172+
TARGET_BUILTIN(__builtin_ia32_tcvtrowps2pbf16h, "V32yIUcUi", "n", "amx-avx512,avx10.2-512")
173+
TARGET_BUILTIN(__builtin_ia32_tcvtrowps2pbf16l, "V32yIUcUi", "n", "amx-avx512,avx10.2-512")
174+
TARGET_BUILTIN(__builtin_ia32_tcvtrowps2phh, "V32xIUcUi", "n", "amx-avx512,avx10.2-512")
175+
TARGET_BUILTIN(__builtin_ia32_tcvtrowps2phl, "V32xIUcUi", "n", "amx-avx512,avx10.2-512")
176+
TARGET_BUILTIN(__builtin_ia32_tilemovrow, "V16iIUcUi", "n", "amx-avx512,avx10.2-512")
165177

166178
// AMX_FP16 FP16
167179
TARGET_BUILTIN(__builtin_ia32_tdpfp16ps, "vIUcIUcIUc", "n", "amx-fp16")
@@ -172,6 +184,14 @@ TARGET_BUILTIN(__builtin_ia32_tdpbhf8ps, "vIUcUIcUIc", "n", "amx-fp8")
172184
TARGET_BUILTIN(__builtin_ia32_tdphbf8ps, "vIUcUIcUIc", "n", "amx-fp8")
173185
TARGET_BUILTIN(__builtin_ia32_tdphf8ps, "vIUcUIcUIc", "n", "amx-fp8")
174186

187+
// AMX TF32
188+
TARGET_BUILTIN(__builtin_ia32_tmmultf32ps, "vIUcIUcIUc", "n", "amx-tf32")
189+
TARGET_BUILTIN(__builtin_ia32_ttmmultf32ps, "vIUcIUcIUc", "n", "amx-tf32,amx-transpose")
190+
191+
TARGET_BUILTIN(__builtin_ia32_prefetchi, "vvC*Ui", "nc", "prefetchi")
192+
TARGET_BUILTIN(__builtin_ia32_cmpccxadd32, "Siv*SiSiIi", "n", "cmpccxadd")
193+
TARGET_BUILTIN(__builtin_ia32_cmpccxadd64, "SLLiSLLi*SLLiSLLiIi", "n", "cmpccxadd")
194+
175195
// RAO-INT
176196
TARGET_BUILTIN(__builtin_ia32_aadd64, "vv*SOi", "n", "raoint")
177197
TARGET_BUILTIN(__builtin_ia32_aand64, "vv*SOi", "n", "raoint")

clang/include/clang/Basic/MacroBuilder.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@ class MacroBuilder {
2626
MacroBuilder(raw_ostream &Output) : Out(Output) {}
2727

2828
/// Append a \#define line for macro of the form "\#define Name Value\n".
29-
void defineMacro(const Twine &Name, const Twine &Value = "1") {
29+
/// If DeprecationMsg is provided, also append a pragma to deprecate the
30+
/// defined macro.
31+
void defineMacro(const Twine &Name, const Twine &Value = "1",
32+
Twine DeprecationMsg = "") {
3033
Out << "#define " << Name << ' ' << Value << '\n';
34+
if (!DeprecationMsg.isTriviallyEmpty())
35+
Out << "#pragma clang deprecated(" << Name << ", \"" << DeprecationMsg
36+
<< "\")\n";
3137
}
3238

3339
/// Append a \#undef line for Name. Name should be of the form XXX

clang/include/clang/Basic/arm_sve.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,9 @@ def SVRSQRTS : SInst<"svrsqrts[_{d}]", "ddd", "hfd", MergeNone, "aarch64_sve_frs
880880
////////////////////////////////////////////////////////////////////////////////
881881
// Floating-point reductions
882882

883-
def SVFADDA : SInst<"svadda[_{d}]", "sPsd", "hfd", MergeNone, "aarch64_sve_fadda", [VerifyRuntimeMode]>;
883+
let SVETargetGuard = "sve", SMETargetGuard = InvalidMode in {
884+
def SVFADDA : SInst<"svadda[_{d}]", "sPsd", "hfd", MergeNone, "aarch64_sve_fadda">;
885+
}
884886
def SVFADDV : SInst<"svaddv[_{d}]", "sPd", "hfd", MergeNone, "aarch64_sve_faddv", [VerifyRuntimeMode]>;
885887
def SVFMAXV : SInst<"svmaxv[_{d}]", "sPd", "hfd", MergeNone, "aarch64_sve_fmaxv", [VerifyRuntimeMode]>;
886888
def SVFMAXNMV : SInst<"svmaxnmv[_{d}]", "sPd", "hfd", MergeNone, "aarch64_sve_fmaxnmv", [VerifyRuntimeMode]>;

0 commit comments

Comments
 (0)