Skip to content

Commit 6c33d97

Browse files
authored
Merge branch 'main' into norx1991-patch-xegpu
2 parents 5be3629 + 964c771 commit 6c33d97

File tree

7 files changed

+43
-23
lines changed

7 files changed

+43
-23
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "lldb/Utility/Stream.h"
2323
#include "lldb/Utility/Timer.h"
2424
#include "lldb/lldb-private-enumerations.h"
25-
#include "llvm/Support/FormatVariadic.h"
2625
#include "llvm/Support/ThreadPool.h"
2726
#include <atomic>
2827
#include <optional>
@@ -33,10 +32,10 @@ using namespace lldb_private::plugin::dwarf;
3332
using namespace llvm::dwarf;
3433

3534
void ManualDWARFIndex::Index() {
36-
if (m_indexed)
37-
return;
38-
m_indexed = true;
35+
std::call_once(m_indexed_flag, [this]() { IndexImpl(); });
36+
}
3937

38+
void ManualDWARFIndex::IndexImpl() {
4039
ElapsedTime elapsed(m_index_time);
4140
LLDB_SCOPED_TIMERF("%p", static_cast<void *>(m_dwarf));
4241
if (LoadFromCache()) {

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,14 @@ class ManualDWARFIndex : public DWARFIndex {
6666
void Dump(Stream &s) override;
6767

6868
private:
69+
/// Reads the DWARF debug info to build the index once.
70+
///
71+
/// Should be called before attempting to retrieve symbols.
6972
void Index();
7073

74+
/// Call `ManualDWARFIndex::Index()` instead.
75+
void IndexImpl();
76+
7177
/// Decode a serialized version of this object from data.
7278
///
7379
/// \param data
@@ -170,7 +176,7 @@ class ManualDWARFIndex : public DWARFIndex {
170176
llvm::DenseSet<uint64_t> m_type_sigs_to_avoid;
171177

172178
IndexSet<NameToDIE> m_set;
173-
bool m_indexed = false;
179+
std::once_flag m_indexed_flag;
174180
};
175181
} // namespace dwarf
176182
} // namespace lldb_private::plugin

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,18 +2871,14 @@ SDValue DAGTypeLegalizer::PromoteIntOp_SET_ROUNDING(SDNode *N) {
28712871
SDValue DAGTypeLegalizer::PromoteIntOp_STACKMAP(SDNode *N, unsigned OpNo) {
28722872
assert(OpNo > 1); // Because the first two arguments are guaranteed legal.
28732873
SmallVector<SDValue> NewOps(N->ops());
2874-
SDValue Operand = N->getOperand(OpNo);
2875-
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), Operand.getValueType());
2876-
NewOps[OpNo] = DAG.getNode(ISD::ANY_EXTEND, SDLoc(N), NVT, Operand);
2874+
NewOps[OpNo] = GetPromotedInteger(NewOps[OpNo]);
28772875
return SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
28782876
}
28792877

28802878
SDValue DAGTypeLegalizer::PromoteIntOp_PATCHPOINT(SDNode *N, unsigned OpNo) {
28812879
assert(OpNo >= 7);
28822880
SmallVector<SDValue> NewOps(N->ops());
2883-
SDValue Operand = N->getOperand(OpNo);
2884-
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), Operand.getValueType());
2885-
NewOps[OpNo] = DAG.getNode(ISD::ANY_EXTEND, SDLoc(N), NVT, Operand);
2881+
NewOps[OpNo] = GetPromotedInteger(NewOps[OpNo]);
28862882
return SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
28872883
}
28882884

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22134,6 +22134,27 @@ bool BoUpSLP::collectValuesToDemote(
2213422134
{VectorizableTree[E.CombinedEntriesWithIndices.front().first].get(),
2213522135
VectorizableTree[E.CombinedEntriesWithIndices.back().first].get()});
2213622136

22137+
if (E.isAltShuffle()) {
22138+
// Combining these opcodes may lead to incorrect analysis, skip for now.
22139+
auto IsDangerousOpcode = [](unsigned Opcode) {
22140+
switch (Opcode) {
22141+
case Instruction::Shl:
22142+
case Instruction::AShr:
22143+
case Instruction::LShr:
22144+
case Instruction::UDiv:
22145+
case Instruction::SDiv:
22146+
case Instruction::URem:
22147+
case Instruction::SRem:
22148+
return true;
22149+
default:
22150+
break;
22151+
}
22152+
return false;
22153+
};
22154+
if (IsDangerousOpcode(E.getAltOpcode()))
22155+
return FinalAnalysis();
22156+
}
22157+
2213722158
switch (E.getOpcode()) {
2213822159

2213922160
// We can always demote truncations and extensions. Since truncations can

llvm/test/CodeGen/AArch64/stackmap.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@
8181
; CHECK-NEXT: .hword 8
8282
; CHECK-NEXT: .hword 0
8383
; CHECK-NEXT: .hword 0
84-
; CHECK-NEXT: .word 65535
84+
; CHECK-NEXT: .word -1
8585
; SmallConstant
8686
; CHECK-NEXT: .byte 4
8787
; CHECK-NEXT: .byte 0
8888
; CHECK-NEXT: .hword 8
8989
; CHECK-NEXT: .hword 0
9090
; CHECK-NEXT: .hword 0
91-
; CHECK-NEXT: .word 65535
91+
; CHECK-NEXT: .word -1
9292
; SmallConstant
9393
; CHECK-NEXT: .byte 4
9494
; CHECK-NEXT: .byte 0

llvm/test/CodeGen/SystemZ/stackmap.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@
8484
; CHECK-NEXT: .short 8
8585
; CHECK-NEXT: .short 0
8686
; CHECK-NEXT: .short 0
87-
; CHECK-NEXT: .long 65535
87+
; CHECK-NEXT: .long -1
8888
; SmallConstant
8989
; CHECK-NEXT: .byte 4
9090
; CHECK-NEXT: .byte 0
9191
; CHECK-NEXT: .short 8
9292
; CHECK-NEXT: .short 0
9393
; CHECK-NEXT: .short 0
94-
; CHECK-NEXT: .long 65535
94+
; CHECK-NEXT: .long -1
9595
; SmallConstant
9696
; CHECK-NEXT: .byte 4
9797
; CHECK-NEXT: .byte 0

llvm/test/Transforms/SLPVectorizer/X86/alternate-opcode-strict-bitwidth-than-main.ll

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ define float @test(i8 %0) {
66
; CHECK-SAME: i8 [[TMP0:%.*]]) {
77
; CHECK-NEXT: [[ENTRY:.*:]]
88
; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i8> <i8 poison, i8 0>, i8 [[TMP0]], i32 0
9-
; CHECK-NEXT: [[TMP2:%.*]] = sext <2 x i8> [[TMP1]] to <2 x i16>
10-
; CHECK-NEXT: [[TMP3:%.*]] = mul <2 x i16> [[TMP2]], <i16 2, i16 27>
11-
; CHECK-NEXT: [[TMP4:%.*]] = lshr <2 x i16> [[TMP2]], <i16 2, i16 27>
12-
; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x i16> [[TMP3]], <2 x i16> [[TMP4]], <2 x i32> <i32 0, i32 3>
13-
; CHECK-NEXT: [[TMP9:%.*]] = extractelement <2 x i16> [[TMP5]], i32 0
14-
; CHECK-NEXT: [[TMP6:%.*]] = sext i16 [[TMP9]] to i32
15-
; CHECK-NEXT: [[TMP10:%.*]] = extractelement <2 x i16> [[TMP5]], i32 1
16-
; CHECK-NEXT: [[TMP7:%.*]] = zext i16 [[TMP10]] to i32
9+
; CHECK-NEXT: [[TMP2:%.*]] = sext <2 x i8> [[TMP1]] to <2 x i32>
10+
; CHECK-NEXT: [[TMP3:%.*]] = mul <2 x i32> [[TMP2]], <i32 2, i32 27>
11+
; CHECK-NEXT: [[TMP4:%.*]] = lshr <2 x i32> [[TMP2]], <i32 2, i32 27>
12+
; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x i32> [[TMP3]], <2 x i32> [[TMP4]], <2 x i32> <i32 0, i32 3>
13+
; CHECK-NEXT: [[TMP6:%.*]] = extractelement <2 x i32> [[TMP5]], i32 0
14+
; CHECK-NEXT: [[TMP7:%.*]] = extractelement <2 x i32> [[TMP5]], i32 1
1715
; CHECK-NEXT: [[TMP8:%.*]] = or i32 [[TMP6]], [[TMP7]]
1816
; CHECK-NEXT: switch i32 [[TMP8]], label %[[EXIT:.*]] [
1917
; CHECK-NEXT: i32 0, label %[[EXIT]]

0 commit comments

Comments
 (0)