Skip to content

Commit 726b6f0

Browse files
authored
merge main into amd-staging (#790)
2 parents bf18dc9 + 7eb6fb9 commit 726b6f0

File tree

100 files changed

+1504
-2425
lines changed

Some content is hidden

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

100 files changed

+1504
-2425
lines changed

.github/workflows/release-sources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
attestations: write
109109
steps:
110110
- name: Checkout Release Scripts
111-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
111+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
112112
with:
113113
sparse-checkout: |
114114
.github/workflows/upload-release-artifact

clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,19 @@ AST_MATCHER(CXXRecordDecl, hasBases) {
2323
}
2424
} // namespace
2525

26-
// Adds a node (by name) to the interface map, if it was not present in the map
26+
// Adds a node to the interface map, if it was not present in the map
2727
// previously.
2828
void MultipleInheritanceCheck::addNodeToInterfaceMap(const CXXRecordDecl *Node,
2929
bool IsInterface) {
30-
assert(Node->getIdentifier());
31-
const StringRef Name = Node->getIdentifier()->getName();
32-
InterfaceMap.insert(std::make_pair(Name, IsInterface));
30+
InterfaceMap.try_emplace(Node, IsInterface);
3331
}
3432

3533
// Returns "true" if the boolean "isInterface" has been set to the
3634
// interface status of the current Node. Return "false" if the
3735
// interface status for the current node is not yet known.
3836
bool MultipleInheritanceCheck::getInterfaceStatus(const CXXRecordDecl *Node,
3937
bool &IsInterface) const {
40-
assert(Node->getIdentifier());
41-
const StringRef Name = Node->getIdentifier()->getName();
42-
auto Pair = InterfaceMap.find(Name);
38+
auto Pair = InterfaceMap.find(Node);
4339
if (Pair == InterfaceMap.end())
4440
return false;
4541
IsInterface = Pair->second;
@@ -59,9 +55,6 @@ bool MultipleInheritanceCheck::isCurrentClassInterface(
5955
}
6056

6157
bool MultipleInheritanceCheck::isInterface(const CXXRecordDecl *Node) {
62-
if (!Node->getIdentifier())
63-
return false;
64-
6558
// Short circuit the lookup if we have analyzed this record before.
6659
bool PreviousIsInterfaceResult = false;
6760
if (getInterfaceStatus(Node, PreviousIsInterfaceResult))

clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class MultipleInheritanceCheck : public ClangTidyCheck {
3838
// Contains the identity of each named CXXRecord as an interface. This is
3939
// used to memoize lookup speeds and improve performance from O(N^2) to O(N),
4040
// where N is the number of classes.
41-
llvm::StringMap<bool> InterfaceMap;
41+
llvm::DenseMap<const CXXRecordDecl *, bool> InterfaceMap;
4242
};
4343

4444
} // namespace clang::tidy::fuchsia

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,12 @@ Changes in existing checks
441441
correctly ignore ``std::array`` and other array-like containers when
442442
`IgnoreArrays` option is set to `true`.
443443

444+
- Improved :doc:`fuchsia-multiple-inheritance
445+
<clang-tidy/checks/fuchsia/multiple-inheritance>`
446+
by fixing an issue where the check would only analyze the first class with
447+
a given name in the program, missing any subsequent classes with that same
448+
name (declared in a different scope).
449+
444450
- Improved :doc:`google-readability-casting
445451
<clang-tidy/checks/google/readability-casting>` check by adding fix-it
446452
notes for downcasts and casts to void pointer.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Checks: '-*'

clang-tools-extra/test/clang-tidy/checkers/fuchsia/multiple-inheritance.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,18 @@ void test_no_crash() {
148148
auto foo = []() {};
149149
WithTemplBase<decltype(foo)>();
150150
}
151+
152+
struct S1 {};
153+
struct S2 {};
154+
155+
struct S3 : S1, S2 {};
156+
157+
namespace N {
158+
159+
struct S1 { int i; };
160+
struct S2 { int i; };
161+
162+
// CHECK-MESSAGES: [[@LINE+1]]:1: warning: inheriting multiple classes that aren't pure virtual is discouraged [fuchsia-multiple-inheritance]
163+
struct S3 : S1, S2 {};
164+
165+
} // namespace N

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,39 +2875,6 @@ static bool interp__builtin_select_scalar(InterpState &S,
28752875
return true;
28762876
}
28772877

2878-
static bool interp__builtin_blend(InterpState &S, CodePtr OpPC,
2879-
const CallExpr *Call) {
2880-
APSInt Mask = popToAPSInt(S, Call->getArg(2));
2881-
const Pointer &TrueVec = S.Stk.pop<Pointer>();
2882-
const Pointer &FalseVec = S.Stk.pop<Pointer>();
2883-
const Pointer &Dst = S.Stk.peek<Pointer>();
2884-
2885-
assert(FalseVec.getNumElems() == TrueVec.getNumElems());
2886-
assert(FalseVec.getNumElems() == Dst.getNumElems());
2887-
unsigned NumElems = FalseVec.getNumElems();
2888-
PrimType ElemT = FalseVec.getFieldDesc()->getPrimType();
2889-
PrimType DstElemT = Dst.getFieldDesc()->getPrimType();
2890-
2891-
for (unsigned I = 0; I != NumElems; ++I) {
2892-
bool MaskBit = Mask[I % 8];
2893-
if (ElemT == PT_Float) {
2894-
assert(DstElemT == PT_Float);
2895-
Dst.elem<Floating>(I) =
2896-
MaskBit ? TrueVec.elem<Floating>(I) : FalseVec.elem<Floating>(I);
2897-
} else {
2898-
assert(DstElemT == ElemT);
2899-
INT_TYPE_SWITCH_NO_BOOL(DstElemT, {
2900-
Dst.elem<T>(I) =
2901-
static_cast<T>(MaskBit ? TrueVec.elem<T>(I).toAPSInt()
2902-
: FalseVec.elem<T>(I).toAPSInt());
2903-
});
2904-
}
2905-
}
2906-
Dst.initializeAllElements();
2907-
2908-
return true;
2909-
}
2910-
29112878
static bool interp__builtin_ia32_test_op(
29122879
InterpState &S, CodePtr OpPC, const CallExpr *Call,
29132880
llvm::function_ref<bool(const APInt &A, const APInt &B)> Fn) {
@@ -4796,7 +4763,15 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
47964763
case clang::X86::BI__builtin_ia32_pblendw256:
47974764
case clang::X86::BI__builtin_ia32_pblendd128:
47984765
case clang::X86::BI__builtin_ia32_pblendd256:
4799-
return interp__builtin_blend(S, OpPC, Call);
4766+
return interp__builtin_ia32_shuffle_generic(
4767+
S, OpPC, Call, [](unsigned DstIdx, unsigned ShuffleMask) {
4768+
// Bit index for mask.
4769+
unsigned MaskBit = (ShuffleMask >> (DstIdx % 8)) & 0x1;
4770+
unsigned SrcVecIdx = MaskBit ? 1 : 0; // 1 = TrueVec, 0 = FalseVec
4771+
return std::pair<unsigned, int>{SrcVecIdx, static_cast<int>(DstIdx)};
4772+
});
4773+
4774+
48004775

48014776
case clang::X86::BI__builtin_ia32_blendvpd:
48024777
case clang::X86::BI__builtin_ia32_blendvpd256:

clang/test/Driver/print-supported-extensions-riscv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
// CHECK-NEXT: xwchc 2.2 'Xwchc' (WCH/QingKe additional compressed opcodes)
218218
// CHECK-EMPTY:
219219
// CHECK-NEXT: Experimental extensions
220-
// CHECK-NEXT: p 0.15 'P' ('Base P' (Packed SIMD))
220+
// CHECK-NEXT: p 0.18 'P' ('Base P' (Packed SIMD))
221221
// CHECK-NEXT: zibi 0.1 'Zibi' (Branch with Immediate)
222222
// CHECK-NEXT: zicfilp 1.0 'Zicfilp' (Landing pad)
223223
// CHECK-NEXT: zicfiss 1.0 'Zicfiss' (Shadow stack)

compiler-rt/lib/builtins/cpu_model/aarch64.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919
#error This file is intended only for aarch64-based targets
2020
#endif
2121

22+
#if __has_include(<sys/ifunc.h>)
23+
#include <sys/ifunc.h>
24+
#else
2225
typedef struct __ifunc_arg_t {
2326
unsigned long _size;
2427
unsigned long _hwcap;
2528
unsigned long _hwcap2;
26-
unsigned long _hwcap3;
27-
unsigned long _hwcap4;
2829
} __ifunc_arg_t;
30+
#endif // __has_include(<sys/ifunc.h>)
2931

3032
// LSE support detection for out-of-line atomics
3133
// using HWCAP and Auxiliary vector

compiler-rt/lib/builtins/cpu_model/aarch64/fmv/android.inc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@ void CONSTRUCTOR_ATTRIBUTE __init_cpu_features(void) {
2727

2828
unsigned long hwcap = getauxval(AT_HWCAP);
2929
unsigned long hwcap2 = getauxval(AT_HWCAP2);
30-
unsigned long hwcap3 = getauxval(AT_HWCAP3);
31-
unsigned long hwcap4 = getauxval(AT_HWCAP4);
3230

3331
__ifunc_arg_t arg;
3432
arg._size = sizeof(__ifunc_arg_t);
3533
arg._hwcap = hwcap;
3634
arg._hwcap2 = hwcap2;
37-
arg._hwcap3 = hwcap3;
38-
arg._hwcap4 = hwcap4;
3935
__init_cpu_features_constructor(hwcap | _IFUNC_ARG_HWCAP, &arg);
4036
}

0 commit comments

Comments
 (0)