Skip to content

Commit ea19599

Browse files
authored
Merge branch 'main' into fix-bazel
2 parents 3061f20 + b757bc8 commit ea19599

File tree

18 files changed

+494
-486
lines changed

18 files changed

+494
-486
lines changed

clang/lib/Analysis/ThreadSafety.cpp

Lines changed: 145 additions & 87 deletions
Large diffs are not rendered by default.

compiler-rt/cmake/config-ix.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,14 @@ macro(get_test_cc_for_arch arch cc_out cflags_out)
309309
endif()
310310
string(REPLACE ";" " " ${cflags_out} "${${cflags_out}}")
311311
endif()
312+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT ANDROID)
313+
# ARM on Linux might use the slow unwinder as default and the unwind table
314+
# is required to get a complete stacktrace.
315+
string(APPEND ${cflags_out} " -funwind-tables")
316+
if(CMAKE_SYSROOT)
317+
string(APPEND ${cflags_out} " --sysroot=${CMAKE_SYSROOT}")
318+
endif()
319+
endif()
312320
endmacro()
313321

314322
# Returns CFLAGS that should be used to run tests for the

compiler-rt/test/sanitizer_common/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,6 @@ foreach(tool ${SUPPORTED_TOOLS})
7373
get_test_cc_for_arch(${arch} SANITIZER_COMMON_TEST_TARGET_CC SANITIZER_COMMON_TEST_TARGET_CFLAGS)
7474
set(CONFIG_NAME ${tool}-${arch}-${OS_NAME})
7575

76-
# ARM on Linux might use the slow unwinder as default and the unwind table is
77-
# required to get a complete stacktrace.
78-
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID)
79-
list(APPEND SANITIZER_COMMON_TEST_TARGET_CFLAGS -funwind-tables)
80-
if(CMAKE_SYSROOT)
81-
list(APPEND SANITIZER_COMMON_TEST_TARGET_CFLAGS "--sysroot=${CMAKE_SYSROOT}")
82-
endif()
83-
string(REPLACE ";" " " SANITIZER_COMMON_TEST_TARGET_CFLAGS
84-
"${SANITIZER_COMMON_TEST_TARGET_CFLAGS}")
85-
endif()
86-
8776
configure_lit_site_cfg(
8877
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
8978
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)

lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,17 @@ DWARFDIE DebugNamesDWARFIndex::GetDIE(const DebugNames::Entry &entry) const {
152152
return DWARFDIE();
153153
}
154154

155-
bool DebugNamesDWARFIndex::ProcessEntry(
155+
IterationAction DebugNamesDWARFIndex::ProcessEntry(
156156
const DebugNames::Entry &entry,
157-
llvm::function_ref<bool(DWARFDIE die)> callback) {
157+
llvm::function_ref<IterationAction(DWARFDIE die)> callback) {
158158
DWARFDIE die = GetDIE(entry);
159159
if (!die)
160-
return true;
160+
return IterationAction::Continue;
161161
// Clang used to erroneously emit index entries for declaration DIEs in case
162162
// when the definition is in a type unit (llvm.org/pr77696).
163163
if (die.IsStructUnionOrClass() &&
164164
die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0))
165-
return true;
165+
return IterationAction::Continue;
166166
return callback(die);
167167
}
168168

@@ -185,7 +185,7 @@ void DebugNamesDWARFIndex::GetGlobalVariables(
185185
if (entry.tag() != DW_TAG_variable)
186186
continue;
187187

188-
if (!ProcessEntry(entry, IterationActionAdaptor(callback)))
188+
if (ProcessEntry(entry, callback) == IterationAction::Stop)
189189
return;
190190
}
191191

@@ -207,7 +207,7 @@ void DebugNamesDWARFIndex::GetGlobalVariables(
207207
if (entry_or->tag() != DW_TAG_variable)
208208
continue;
209209

210-
if (!ProcessEntry(*entry_or, IterationActionAdaptor(callback)))
210+
if (ProcessEntry(*entry_or, callback) == IterationAction::Stop)
211211
return;
212212
}
213213
MaybeLogLookupError(entry_or.takeError(), ni, nte.getString());
@@ -243,7 +243,7 @@ void DebugNamesDWARFIndex::GetGlobalVariables(
243243
continue;
244244

245245
found_entry_for_cu = true;
246-
if (!ProcessEntry(*entry_or, IterationActionAdaptor(callback)))
246+
if (ProcessEntry(*entry_or, callback) == IterationAction::Stop)
247247
return;
248248
}
249249
MaybeLogLookupError(entry_or.takeError(), ni, nte.getString());
@@ -358,16 +358,15 @@ void DebugNamesDWARFIndex::GetFullyQualifiedType(
358358

359359
if (!parent_chain) {
360360
// Fallback: use the base class implementation.
361-
if (!ProcessEntry(entry, IterationActionAdaptor([&](DWARFDIE die) {
362-
return GetFullyQualifiedTypeImpl(context, die,
363-
callback);
364-
})))
361+
if (ProcessEntry(entry, [&](DWARFDIE die) {
362+
return GetFullyQualifiedTypeImpl(context, die, callback);
363+
}) == IterationAction::Stop)
365364
return;
366365
continue;
367366
}
368367

369368
if (SameParentChain(parent_names, *parent_chain)) {
370-
if (!ProcessEntry(entry, IterationActionAdaptor(callback)))
369+
if (ProcessEntry(entry, callback) == IterationAction::Stop)
371370
return;
372371
}
373372
}
@@ -462,7 +461,7 @@ void DebugNamesDWARFIndex::GetTypes(
462461
for (const DebugNames::Entry &entry :
463462
m_debug_names_up->equal_range(name.GetStringRef())) {
464463
if (isType(entry.tag())) {
465-
if (!ProcessEntry(entry, IterationActionAdaptor(callback)))
464+
if (ProcessEntry(entry, callback) == IterationAction::Stop)
466465
return;
467466
}
468467
}
@@ -476,7 +475,7 @@ void DebugNamesDWARFIndex::GetTypes(
476475
auto name = context[0].name;
477476
for (const DebugNames::Entry &entry : m_debug_names_up->equal_range(name)) {
478477
if (entry.tag() == context[0].tag) {
479-
if (!ProcessEntry(entry, IterationActionAdaptor(callback)))
478+
if (ProcessEntry(entry, callback) == IterationAction::Stop)
480479
return;
481480
}
482481
}
@@ -492,7 +491,7 @@ void DebugNamesDWARFIndex::GetNamespaces(
492491
llvm::dwarf::Tag entry_tag = entry.tag();
493492
if (entry_tag == DW_TAG_namespace ||
494493
entry_tag == DW_TAG_imported_declaration) {
495-
if (!ProcessEntry(entry, IterationActionAdaptor(callback)))
494+
if (ProcessEntry(entry, callback) == IterationAction::Stop)
496495
return;
497496
}
498497
}
@@ -549,21 +548,20 @@ void DebugNamesDWARFIndex::GetTypesWithQuery(
549548
getParentChain(entry);
550549
if (!parent_chain) {
551550
// Fallback: use the base class implementation.
552-
if (!ProcessEntry(entry, IterationActionAdaptor([&](DWARFDIE die) {
553-
return ProcessTypeDIEMatchQuery(query, die, callback);
554-
})))
551+
if (ProcessEntry(entry, [&](DWARFDIE die) {
552+
return ProcessTypeDIEMatchQuery(query, die, callback);
553+
}) == IterationAction::Stop)
555554
return;
556555
continue;
557556
}
558557

559558
if (WithinParentChain(parent_contexts, *parent_chain)) {
560-
if (!ProcessEntry(entry, IterationActionAdaptor([&](DWARFDIE die) {
561-
// After .debug_names filtering still sending to base
562-
// class for further filtering before calling the
563-
// callback.
564-
return ProcessTypeDIEMatchQuery(query, die, callback);
565-
})))
566-
// If the callback returns false, we're done.
559+
if (ProcessEntry(entry, [&](DWARFDIE die) {
560+
// After .debug_names filtering still sending to base
561+
// class for further filtering before calling the
562+
// callback.
563+
return ProcessTypeDIEMatchQuery(query, die, callback);
564+
}) == IterationAction::Stop)
567565
return;
568566
}
569567
}
@@ -588,23 +586,22 @@ void DebugNamesDWARFIndex::GetNamespacesWithParents(
588586
getParentChain(entry);
589587
if (!parent_chain) {
590588
// Fallback: use the base class implementation.
591-
if (!ProcessEntry(entry, IterationActionAdaptor([&](DWARFDIE die) {
592-
return ProcessNamespaceDieMatchParents(
593-
parent_decl_ctx, die, callback);
594-
})))
589+
if (ProcessEntry(entry, [&](DWARFDIE die) {
590+
return ProcessNamespaceDieMatchParents(parent_decl_ctx, die,
591+
callback);
592+
}) == IterationAction::Stop)
595593
return;
596594
continue;
597595
}
598596

599597
if (WithinParentChain(parent_named_contexts, *parent_chain)) {
600-
if (!ProcessEntry(entry, IterationActionAdaptor([&](DWARFDIE die) {
601-
// After .debug_names filtering still sending to
602-
// base class for further filtering before calling
603-
// the callback.
604-
return ProcessNamespaceDieMatchParents(
605-
parent_decl_ctx, die, callback);
606-
})))
607-
// If the callback returns false, we're done.
598+
if (ProcessEntry(entry, [&](DWARFDIE die) {
599+
// After .debug_names filtering still sending to
600+
// base class for further filtering before calling
601+
// the callback.
602+
return ProcessNamespaceDieMatchParents(parent_decl_ctx, die,
603+
callback);
604+
}) == IterationAction::Stop)
608605
return;
609606
}
610607
}
@@ -653,7 +650,7 @@ void DebugNamesDWARFIndex::GetFunctions(
653650
if (tag != DW_TAG_subprogram && tag != DW_TAG_inlined_subroutine)
654651
continue;
655652

656-
if (!ProcessEntry(*entry_or, IterationActionAdaptor(callback)))
653+
if (ProcessEntry(*entry_or, callback) == IterationAction::Stop)
657654
return;
658655
}
659656
MaybeLogLookupError(entry_or.takeError(), ni, nte.getString());

lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ class DebugNamesDWARFIndex : public DWARFIndex {
122122
std::optional<DWARFTypeUnit *>
123123
GetForeignTypeUnit(const DebugNames::Entry &entry) const;
124124

125-
bool ProcessEntry(const DebugNames::Entry &entry,
126-
llvm::function_ref<bool(DWARFDIE die)> callback);
125+
IterationAction
126+
ProcessEntry(const DebugNames::Entry &entry,
127+
llvm::function_ref<IterationAction(DWARFDIE die)> callback);
127128

128129
/// Returns true if `parent_entries` have identical names to `parent_names`.
129130
bool SameParentChain(llvm::ArrayRef<llvm::StringRef> parent_names,

llvm/lib/Target/AMDGPU/AMDGPUGISel.td

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,6 @@ def gi_vop3pmodsdot :
5151
GIComplexOperandMatcher<s32, "selectVOP3PModsDOT">,
5252
GIComplexPatternEquiv<VOP3PModsDOT>;
5353

54-
def gi_vop3pmodsneg :
55-
GIComplexOperandMatcher<s32, "selectVOP3PModsNeg">,
56-
GIComplexPatternEquiv<VOP3PModsNeg>;
57-
58-
def gi_vop3pmodsnegs :
59-
GIComplexOperandMatcher<s32, "selectVOP3PModsNegs">,
60-
GIComplexPatternEquiv<VOP3PModsNegs>;
61-
62-
def gi_dotiuvop3pmodsnegabs :
63-
GIComplexOperandMatcher<s32, "selectVOP3PModsNegAbs">,
64-
GIComplexPatternEquiv<VOP3PModsNegAbs>;
65-
6654
def gi_wmmaopselvop3pmods :
6755
GIComplexOperandMatcher<s32, "selectWMMAOpSelVOP3PMods">,
6856
GIComplexPatternEquiv<WMMAOpSelVOP3PMods>;
@@ -452,6 +440,13 @@ def gi_fp_pow2_to_exponent : GICustomOperandRenderer<"renderFPPow2ToExponent">,
452440
def gi_as_hw_round_mode : GICustomOperandRenderer<"renderRoundMode">,
453441
GISDNodeXFormEquiv<as_hw_round_mode>;
454442

443+
def gi_VOP3PModsNeg : GICustomOperandRenderer<"renderVOP3PModsNeg">,
444+
GISDNodeXFormEquiv<VOP3PModsNeg>;
445+
def gi_VOP3PModsNegs : GICustomOperandRenderer<"renderVOP3PModsNegs">,
446+
GISDNodeXFormEquiv<VOP3PModsNegs>;
447+
def gi_VOP3PModsNegAbs : GICustomOperandRenderer<"renderVOP3PModsNegAbs">,
448+
GISDNodeXFormEquiv<VOP3PModsNegAbs>;
449+
455450
def gi_prefetch_loc : GICustomOperandRenderer<"renderPrefetchLoc">,
456451
GISDNodeXFormEquiv<PrefetchLoc>;
457452

llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3449,63 +3449,6 @@ bool AMDGPUDAGToDAGISel::SelectVOP3PModsDOT(SDValue In, SDValue &Src,
34493449
return SelectVOP3PMods(In, Src, SrcMods, true);
34503450
}
34513451

3452-
// Select neg_lo from the i1 immediate operand.
3453-
bool AMDGPUDAGToDAGISel::SelectVOP3PModsNeg(SDValue In, SDValue &Src) const {
3454-
const ConstantSDNode *C = cast<ConstantSDNode>(In);
3455-
// Literal i1 value set in intrinsic, represents SrcMods for the next operand.
3456-
// 1 promotes packed values to signed, 0 treats them as unsigned.
3457-
assert(C->getAPIntValue().getBitWidth() == 1 && "expected i1 value");
3458-
3459-
unsigned Mods = SISrcMods::OP_SEL_1;
3460-
unsigned SrcSign = C->getZExtValue();
3461-
if (SrcSign == 1)
3462-
Mods ^= SISrcMods::NEG;
3463-
3464-
Src = CurDAG->getTargetConstant(Mods, SDLoc(In), MVT::i32);
3465-
return true;
3466-
}
3467-
3468-
// Select both neg_lo and neg_hi from the i1 immediate operand. This is
3469-
// specifically for F16/BF16 operands in WMMA instructions, where neg_lo applies
3470-
// to matrix's even k elements, and neg_hi applies to matrix's odd k elements.
3471-
bool AMDGPUDAGToDAGISel::SelectVOP3PModsNegs(SDValue In, SDValue &Src) const {
3472-
const ConstantSDNode *C = cast<ConstantSDNode>(In);
3473-
// Literal i1 value set in intrinsic, represents SrcMods for the next operand.
3474-
// 1 promotes packed values to signed, 0 treats them as unsigned.
3475-
assert(C->getAPIntValue().getBitWidth() == 1 && "expected i1 value");
3476-
3477-
unsigned Mods = SISrcMods::OP_SEL_1;
3478-
unsigned SrcSign = C->getZExtValue();
3479-
if (SrcSign == 1)
3480-
Mods ^= (SISrcMods::NEG | SISrcMods::NEG_HI);
3481-
3482-
Src = CurDAG->getTargetConstant(Mods, SDLoc(In), MVT::i32);
3483-
return true;
3484-
}
3485-
3486-
// Select neg, abs, or both neg and abs from the i16 immediate operans.
3487-
bool AMDGPUDAGToDAGISel::SelectVOP3PModsNegAbs(SDValue In, SDValue &Src) const {
3488-
const ConstantSDNode *C = cast<ConstantSDNode>(In);
3489-
unsigned Mods = SISrcMods::OP_SEL_1;
3490-
unsigned SrcMod = C->getZExtValue();
3491-
switch (SrcMod) {
3492-
default: // Any other value will be silently ignored (considered as 0).
3493-
break;
3494-
case 1:
3495-
Mods ^= SISrcMods::NEG;
3496-
break;
3497-
case 2:
3498-
Mods ^= SISrcMods::ABS;
3499-
break;
3500-
case 3:
3501-
Mods ^= (SISrcMods::NEG | SISrcMods::ABS);
3502-
break;
3503-
}
3504-
3505-
Src = CurDAG->getTargetConstant(Mods, SDLoc(In), MVT::i32);
3506-
return true;
3507-
}
3508-
35093452
bool AMDGPUDAGToDAGISel::SelectWMMAOpSelVOP3PMods(SDValue In,
35103453
SDValue &Src) const {
35113454
const ConstantSDNode *C = cast<ConstantSDNode>(In);

llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,6 @@ class AMDGPUDAGToDAGISel : public SelectionDAGISel {
241241
bool IsDOT = false) const;
242242
bool SelectVOP3PModsDOT(SDValue In, SDValue &Src, SDValue &SrcMods) const;
243243

244-
bool SelectVOP3PModsNeg(SDValue In, SDValue &Src) const;
245-
bool SelectVOP3PModsNegs(SDValue In, SDValue &Src) const;
246-
bool SelectVOP3PModsNegAbs(SDValue In, SDValue &Src) const;
247244
bool SelectWMMAOpSelVOP3PMods(SDValue In, SDValue &Src) const;
248245

249246
bool SelectWMMAModsF32NegAbs(SDValue In, SDValue &Src,

0 commit comments

Comments
 (0)