Skip to content

Commit ba15842

Browse files
committed
Merge remote-tracking branch 'origin/main' into vplan-remove-region-before-cg
2 parents 3a064e7 + b96c5df commit ba15842

File tree

157 files changed

+1504
-968
lines changed

Some content is hidden

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

157 files changed

+1504
-968
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ C++23 Feature Support
120120

121121
C++20 Feature Support
122122
^^^^^^^^^^^^^^^^^^^^^
123+
- Fixed a crash with a defaulted spaceship (``<=>``) operator when the class
124+
contains a member declaration of vector type. Vector types cannot yet be
125+
compared directly, so this causes the operator to be deleted. (#GH137452)
123126

124127
C++17 Feature Support
125128
^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/BuiltinsNVPTX.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,12 @@ def __nvvm_e2m3x2_to_f16x2_rn_relu : NVPTXBuiltinSMAndPTX<"_Vector<2, __fp16>(sh
620620
def __nvvm_e3m2x2_to_f16x2_rn : NVPTXBuiltinSMAndPTX<"_Vector<2, __fp16>(short)", SM<"100a", [SM_101a, SM_120a]>, PTX86>;
621621
def __nvvm_e3m2x2_to_f16x2_rn_relu : NVPTXBuiltinSMAndPTX<"_Vector<2, __fp16>(short)", SM<"100a", [SM_101a, SM_120a]>, PTX86>;
622622

623+
def __nvvm_ff_to_e2m1x2_rn_satfinite : NVPTXBuiltinSMAndPTX<"short(float, float)", SM<"100a", [SM_101a, SM_120a]>, PTX86>;
624+
def __nvvm_ff_to_e2m1x2_rn_relu_satfinite : NVPTXBuiltinSMAndPTX<"short(float, float)", SM<"100a", [SM_101a, SM_120a]>, PTX86>;
625+
626+
def __nvvm_e2m1x2_to_f16x2_rn : NVPTXBuiltinSMAndPTX<"_Vector<2, __fp16>(short)", SM<"100a", [SM_101a, SM_120a]>, PTX86>;
627+
def __nvvm_e2m1x2_to_f16x2_rn_relu : NVPTXBuiltinSMAndPTX<"_Vector<2, __fp16>(short)", SM<"100a", [SM_101a, SM_120a]>, PTX86>;
628+
623629
def __nvvm_ff_to_ue8m0x2_rz : NVPTXBuiltinSMAndPTX<"short(float, float)", SM<"100a", [SM_101a, SM_120a]>, PTX86>;
624630
def __nvvm_ff_to_ue8m0x2_rz_satfinite : NVPTXBuiltinSMAndPTX<"short(float, float)", SM<"100a", [SM_101a, SM_120a]>, PTX86>;
625631
def __nvvm_ff_to_ue8m0x2_rp : NVPTXBuiltinSMAndPTX<"short(float, float)", SM<"100a", [SM_101a, SM_120a]>, PTX86>;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10185,6 +10185,9 @@ def note_defaulted_comparison_no_viable_function_synthesized : Note<
1018510185
def note_defaulted_comparison_not_rewritten_callee : Note<
1018610186
"defaulted %0 is implicitly deleted because this non-rewritten comparison "
1018710187
"function would be the best match for the comparison">;
10188+
def note_defaulted_comparison_vector_types : Note<
10189+
"defaulted %0 is implicitly deleted because defaulted comparison of vector "
10190+
"types is not supported">;
1018810191
def note_defaulted_comparison_not_rewritten_conversion : Note<
1018910192
"defaulted %0 is implicitly deleted because a builtin comparison function "
1019010193
"using this conversion would be the best match for the comparison">;

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8651,6 +8651,18 @@ class DefaultedComparisonAnalyzer
86518651
assert(Best->BuiltinParamTypes[2].isNull() &&
86528652
"invalid builtin comparison");
86538653

8654+
// FIXME: If the type we deduced is a vector type, we mark the
8655+
// comparison as deleted because we don't yet support this.
8656+
if (isa<VectorType>(T)) {
8657+
if (Diagnose == ExplainDeleted) {
8658+
S.Diag(FD->getLocation(),
8659+
diag::note_defaulted_comparison_vector_types)
8660+
<< FD;
8661+
S.Diag(Subobj.Decl->getLocation(), diag::note_declared_at);
8662+
}
8663+
return Result::deleted();
8664+
}
8665+
86548666
if (NeedsDeducing) {
86558667
std::optional<ComparisonCategoryType> Cat =
86568668
getComparisonCategoryForBuiltinCmp(T);

clang/test/CodeGen/builtins-nvptx.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,26 @@ __device__ void nvvm_cvt_sm100a_sm101a_sm120a() {
11271127
// CHECK_PTX86_SM120a: call <2 x half> @llvm.nvvm.e3m2x2.to.f16x2.rn.relu(i16 19532)
11281128
__nvvm_e3m2x2_to_f16x2_rn_relu(0x4C4C);
11291129

1130+
// CHECK_PTX86_SM100a: call i16 @llvm.nvvm.ff.to.e2m1x2.rn.satfinite(float 1.000000e+00, float 1.000000e+00)
1131+
// CHECK_PTX86_SM101a: call i16 @llvm.nvvm.ff.to.e2m1x2.rn.satfinite(float 1.000000e+00, float 1.000000e+00)
1132+
// CHECK_PTX86_SM120a: call i16 @llvm.nvvm.ff.to.e2m1x2.rn.satfinite(float 1.000000e+00, float 1.000000e+00)
1133+
__nvvm_ff_to_e2m1x2_rn_satfinite(1.0f, 1.0f);
1134+
1135+
// CHECK_PTX86_SM100a: call i16 @llvm.nvvm.ff.to.e2m1x2.rn.relu.satfinite(float 1.000000e+00, float 1.000000e+00)
1136+
// CHECK_PTX86_SM101a: call i16 @llvm.nvvm.ff.to.e2m1x2.rn.relu.satfinite(float 1.000000e+00, float 1.000000e+00)
1137+
// CHECK_PTX86_SM120a: call i16 @llvm.nvvm.ff.to.e2m1x2.rn.relu.satfinite(float 1.000000e+00, float 1.000000e+00)
1138+
__nvvm_ff_to_e2m1x2_rn_relu_satfinite(1.0f, 1.0f);
1139+
1140+
// CHECK_PTX86_SM100a: call <2 x half> @llvm.nvvm.e2m1x2.to.f16x2.rn(i16 76)
1141+
// CHECK_PTX86_SM101a: call <2 x half> @llvm.nvvm.e2m1x2.to.f16x2.rn(i16 76)
1142+
// CHECK_PTX86_SM120a: call <2 x half> @llvm.nvvm.e2m1x2.to.f16x2.rn(i16 76)
1143+
__nvvm_e2m1x2_to_f16x2_rn(0x004C);
1144+
1145+
// CHECK_PTX86_SM100a: call <2 x half> @llvm.nvvm.e2m1x2.to.f16x2.rn.relu(i16 76)
1146+
// CHECK_PTX86_SM101a: call <2 x half> @llvm.nvvm.e2m1x2.to.f16x2.rn.relu(i16 76)
1147+
// CHECK_PTX86_SM120a: call <2 x half> @llvm.nvvm.e2m1x2.to.f16x2.rn.relu(i16 76)
1148+
__nvvm_e2m1x2_to_f16x2_rn_relu(0x004C);
1149+
11301150
// CHECK_PTX86_SM100a: call i16 @llvm.nvvm.ff.to.ue8m0x2.rz(float 1.000000e+00, float 1.000000e+00)
11311151
// CHECK_PTX86_SM101a: call i16 @llvm.nvvm.ff.to.ue8m0x2.rz(float 1.000000e+00, float 1.000000e+00)
11321152
// CHECK_PTX86_SM120a: call i16 @llvm.nvvm.ff.to.ue8m0x2.rz(float 1.000000e+00, float 1.000000e+00)

clang/test/SemaCXX/cxx2a-three-way-comparison.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,12 @@ namespace PR44325 {
5858
// implicit rewrite rules, not for explicit use by programs.
5959
bool c = cmp_cat() < 0; // expected-warning {{zero as null pointer constant}}
6060
}
61+
62+
namespace GH137452 {
63+
struct comparable_t {
64+
__attribute__((vector_size(32))) double numbers; // expected-note {{declared here}}
65+
auto operator<=>(const comparable_t& rhs) const = default; // expected-warning {{explicitly defaulted three-way comparison operator is implicitly deleted}} \
66+
expected-note {{replace 'default' with 'delete'}} \
67+
expected-note {{defaulted 'operator<=>' is implicitly deleted because defaulted comparison of vector types is not supported}}
68+
};
69+
} // namespace GH137452

lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <optional>
2020

2121
using namespace lldb;
22+
using namespace lldb_private;
2223

2324
LLDB_PLUGIN_DEFINE(ABIAArch64)
2425

@@ -200,3 +201,44 @@ void ABIAArch64::AugmentRegisterInfo(
200201
lldb::eEncodingIEEE754, lldb::eFormatFloat);
201202
}
202203
}
204+
205+
UnwindPlanSP ABIAArch64::CreateFunctionEntryUnwindPlan() {
206+
UnwindPlan::Row row;
207+
208+
// Our previous Call Frame Address is the stack pointer
209+
row.GetCFAValue().SetIsRegisterPlusOffset(LLDB_REGNUM_GENERIC_SP, 0);
210+
211+
// Our previous PC is in the LR, all other registers are the same.
212+
row.SetRegisterLocationToRegister(LLDB_REGNUM_GENERIC_PC,
213+
LLDB_REGNUM_GENERIC_RA, true);
214+
215+
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindGeneric);
216+
plan_sp->AppendRow(std::move(row));
217+
plan_sp->SetSourceName("arm64 at-func-entry default");
218+
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
219+
plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
220+
plan_sp->SetUnwindPlanForSignalTrap(eLazyBoolNo);
221+
return plan_sp;
222+
}
223+
224+
UnwindPlanSP ABIAArch64::CreateDefaultUnwindPlan() {
225+
UnwindPlan::Row row;
226+
const int32_t ptr_size = 8;
227+
228+
row.GetCFAValue().SetIsRegisterPlusOffset(LLDB_REGNUM_GENERIC_FP,
229+
2 * ptr_size);
230+
row.SetUnspecifiedRegistersAreUndefined(true);
231+
232+
row.SetRegisterLocationToAtCFAPlusOffset(LLDB_REGNUM_GENERIC_FP,
233+
ptr_size * -2, true);
234+
row.SetRegisterLocationToAtCFAPlusOffset(LLDB_REGNUM_GENERIC_PC,
235+
ptr_size * -1, true);
236+
237+
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindGeneric);
238+
plan_sp->AppendRow(std::move(row));
239+
plan_sp->SetSourceName("arm64 default unwind plan");
240+
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
241+
plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
242+
plan_sp->SetUnwindPlanForSignalTrap(eLazyBoolNo);
243+
return plan_sp;
244+
}

lldb/source/Plugins/ABI/AArch64/ABIAArch64.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class ABIAArch64 : public lldb_private::MCBasedABI {
1919
lldb::addr_t FixCodeAddress(lldb::addr_t pc) override;
2020
lldb::addr_t FixDataAddress(lldb::addr_t pc) override;
2121

22+
lldb::UnwindPlanSP CreateFunctionEntryUnwindPlan() override;
23+
lldb::UnwindPlanSP CreateDefaultUnwindPlan() override;
24+
2225
protected:
2326
virtual lldb::addr_t FixAddress(lldb::addr_t pc, lldb::addr_t mask) {
2427
return pc;

lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "lldb/Core/Module.h"
1818
#include "lldb/Core/PluginManager.h"
1919
#include "lldb/Core/Value.h"
20-
#include "lldb/Symbol/UnwindPlan.h"
2120
#include "lldb/Target/Process.h"
2221
#include "lldb/Target/RegisterContext.h"
2322
#include "lldb/Target/Target.h"
@@ -30,8 +29,6 @@
3029
#include "lldb/Utility/Status.h"
3130
#include "lldb/ValueObject/ValueObjectConstResult.h"
3231

33-
#include "Utility/ARM64_DWARF_Registers.h"
34-
3532
using namespace lldb;
3633
using namespace lldb_private;
3734

@@ -344,48 +341,6 @@ ABIMacOSX_arm64::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
344341
return error;
345342
}
346343

347-
UnwindPlanSP ABIMacOSX_arm64::CreateFunctionEntryUnwindPlan() {
348-
uint32_t lr_reg_num = arm64_dwarf::lr;
349-
uint32_t sp_reg_num = arm64_dwarf::sp;
350-
uint32_t pc_reg_num = arm64_dwarf::pc;
351-
352-
UnwindPlan::Row row;
353-
354-
// Our previous Call Frame Address is the stack pointer
355-
row.GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
356-
357-
// Our previous PC is in the LR, all other registers are the same.
358-
row.SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
359-
360-
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
361-
plan_sp->AppendRow(std::move(row));
362-
plan_sp->SetSourceName("arm64 at-func-entry default");
363-
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
364-
return plan_sp;
365-
}
366-
367-
UnwindPlanSP ABIMacOSX_arm64::CreateDefaultUnwindPlan() {
368-
uint32_t fp_reg_num = arm64_dwarf::fp;
369-
uint32_t pc_reg_num = arm64_dwarf::pc;
370-
371-
UnwindPlan::Row row;
372-
const int32_t ptr_size = 8;
373-
374-
row.GetCFAValue().SetIsRegisterPlusOffset(fp_reg_num, 2 * ptr_size);
375-
row.SetUnspecifiedRegistersAreUndefined(true);
376-
377-
row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
378-
row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
379-
380-
auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
381-
plan_sp->AppendRow(std::move(row));
382-
plan_sp->SetSourceName("arm64-apple-darwin default unwind plan");
383-
plan_sp->SetSourcedFromCompiler(eLazyBoolNo);
384-
plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
385-
plan_sp->SetUnwindPlanForSignalTrap(eLazyBoolNo);
386-
return plan_sp;
387-
}
388-
389344
// AAPCS64 (Procedure Call Standard for the ARM 64-bit Architecture) says
390345
// registers x19 through x28 and sp are callee preserved. v8-v15 are non-
391346
// volatile (and specifically only the lower 8 bytes of these regs), the rest

lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ class ABIMacOSX_arm64 : public ABIAArch64 {
2727
bool GetArgumentValues(lldb_private::Thread &thread,
2828
lldb_private::ValueList &values) const override;
2929

30-
lldb::UnwindPlanSP CreateFunctionEntryUnwindPlan() override;
31-
32-
lldb::UnwindPlanSP CreateDefaultUnwindPlan() override;
33-
3430
bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override;
3531

3632
// The arm64 ABI requires that stack frames be 16 byte aligned.

0 commit comments

Comments
 (0)