Skip to content

Commit 8dda516

Browse files
committedNov 30, 2021
[DebugInfo][InstrRef] Avoid dropping fragment info during PHI elimination
InstrRefBasedLDV used to crash on the added test -- the exit block is not in scope for the variable being propagated, but is still considered because it contains an assignment. The failure-mode was vlocJoin ignoring assign-only blocks and not updating DIExpressions, but pickVPHILoc would still find a variable location for it. That led to DBG_VALUEs created with the wrong fragment information. Fix this by removing a filter inherited from VarLocBasedLDV: vlocJoin will now consider assign-only blocks and will update their expressions. Differential Revision: https://reviews.llvm.org/D114727
1 parent 52ff3b0 commit 8dda516

File tree

4 files changed

+174
-31
lines changed

4 files changed

+174
-31
lines changed
 

‎llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp

+3-8
Original file line numberDiff line numberDiff line change
@@ -2352,15 +2352,8 @@ Optional<ValueIDNum> InstrRefBasedLDV::pickVPHILoc(
23522352

23532353
bool InstrRefBasedLDV::vlocJoin(
23542354
MachineBasicBlock &MBB, LiveIdxT &VLOCOutLocs,
2355-
SmallPtrSet<const MachineBasicBlock *, 8> &InScopeBlocks,
23562355
SmallPtrSet<const MachineBasicBlock *, 8> &BlocksToExplore,
23572356
DbgValue &LiveIn) {
2358-
// To emulate VarLocBasedImpl, process this block if it's not in scope but
2359-
// _does_ assign a variable value. No live-ins for this scope are transferred
2360-
// in though, so we can return immediately.
2361-
if (InScopeBlocks.count(&MBB) == 0 && !ArtificialBlocks.count(&MBB))
2362-
return false;
2363-
23642357
LLVM_DEBUG(dbgs() << "join MBB: " << MBB.getNumber() << "\n");
23652358
bool Changed = false;
23662359

@@ -2664,7 +2657,7 @@ void InstrRefBasedLDV::buildVLocValueMap(const DILocation *DILoc,
26642657
// Join values from predecessors. Updates LiveInIdx, and writes output
26652658
// into JoinedInLocs.
26662659
bool InLocsChanged =
2667-
vlocJoin(*MBB, LiveOutIdx, InScopeBlocks, BlocksToExplore, *LiveIn);
2660+
vlocJoin(*MBB, LiveOutIdx, BlocksToExplore, *LiveIn);
26682661

26692662
SmallVector<const MachineBasicBlock *, 8> Preds;
26702663
for (const auto *Pred : MBB->predecessors())
@@ -2759,6 +2752,8 @@ void InstrRefBasedLDV::buildVLocValueMap(const DILocation *DILoc,
27592752
continue;
27602753
if (BlockLiveIn->Kind == DbgValue::VPHI)
27612754
BlockLiveIn->Kind = DbgValue::Def;
2755+
assert(BlockLiveIn->Properties.DIExpr->getFragmentInfo() ==
2756+
Var.getFragment() && "Fragment info missing during value prop");
27622757
Output[MBB->getNumber()].push_back(std::make_pair(Var, *BlockLiveIn));
27632758
}
27642759
} // Per-variable loop.

‎llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h

-1
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,6 @@ class InstrRefBasedLDV : public LDVImpl {
10061006
/// \returns true if any live-ins change value, either from value propagation
10071007
/// or PHI elimination.
10081008
bool vlocJoin(MachineBasicBlock &MBB, LiveIdxT &VLOCOutLocs,
1009-
SmallPtrSet<const MachineBasicBlock *, 8> &InScopeBlocks,
10101009
SmallPtrSet<const MachineBasicBlock *, 8> &BlocksToExplore,
10111010
DbgValue &LiveIn);
10121011

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# RUN: llc %s -o - -run-pass=livedebugvalues -march=x86-64 \
2+
# RUN: -experimental-debug-variable-locations=true \
3+
# RUN: | FileCheck %s
4+
#
5+
## This test used to crash InstrRefBasedLDV, due to fragment information going
6+
## missing; test for that, and also check what happens when we have assignments
7+
## outside of lexical scope. In the IR below, "_First" is only in scope in the
8+
## entry block, but is assigned in every block. Under current behaviour, that
9+
## means that InstrRefBasedLDV will propagate its location through all blocks.
10+
#
11+
# CHECK: ![[FIRSTVAR:[0-9]+]] = !DILocalVariable(name: "_First",
12+
#
13+
# CHECK-LABEL: bb.0.entry:
14+
# CHECK: DBG_VALUE $rbx, $noreg, ![[FIRSTVAR]],
15+
# CHECK-SAME: !DIExpression(DW_OP_LLVM_fragment, 64, 64)
16+
#
17+
# CHECK-LABEL: bb.1.if.then.i.i.i.i.i:
18+
# CHECK: DBG_VALUE $rbx, $noreg, ![[FIRSTVAR]],
19+
# CHECK-SAME: !DIExpression(DW_OP_LLVM_fragment, 64, 64)
20+
# CHECK: DBG_INSTR_REF {{.*}} ![[FIRSTVAR]],
21+
# CHECK: DBG_VALUE $rbx, $noreg, ![[FIRSTVAR]],
22+
# CHECK-SAME: !DIExpression(DW_OP_LLVM_fragment, 64, 64)
23+
24+
# CHECK-LABEL: bb.2._Z17do_insert_cv_testI5_TreeEvv.exit:
25+
# CHECK: DBG_VALUE $rbx, $noreg, ![[FIRSTVAR]],
26+
# CHECK-SAME: !DIExpression(DW_OP_LLVM_fragment, 64, 64)
27+
# CHECK: DBG_INSTR_REF {{.*}} ![[FIRSTVAR]],
28+
# CHECK: DBG_VALUE $rbx, $noreg, ![[FIRSTVAR]],
29+
# CHECK-SAME: !DIExpression(DW_OP_LLVM_fragment, 64, 64)
30+
31+
--- |
32+
source_filename = "reduced.ll"
33+
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
34+
35+
%class._Tree = type { i8 }
36+
%class._Tree_const_iterator = type { %class._Tree_unchecked_const_iterator }
37+
%class._Tree_unchecked_const_iterator = type { %struct._Iterator_base0, i32* }
38+
%struct._Iterator_base0 = type { i32 }
39+
40+
define i32 @main({ i32, i32* } %call.i) !dbg !6 {
41+
entry:
42+
call void @llvm.dbg.value(metadata i32 2, metadata !10, metadata !DIExpression()), !dbg !12
43+
%call.i1 = call { i32, i32* } undef(%class._Tree* null)
44+
%0 = extractvalue { i32, i32* } %call.i, 1
45+
call void @llvm.dbg.value(metadata i32* %0, metadata !13, metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64)), !dbg !15
46+
%call.i.i.i.i.i = call i8 undef(i32* null), !dbg !15
47+
br i1 undef, label %_Z17do_insert_cv_testI5_TreeEvv.exit, label %if.then.i.i.i.i.i
48+
49+
if.then.i.i.i.i.i:
50+
%call3.i.i.i.i.i = call i32* undef(i32* null)
51+
call void @llvm.dbg.value(metadata i32* %call3.i.i.i.i.i, metadata !13, metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64)), !dbg !15
52+
br label %_Z17do_insert_cv_testI5_TreeEvv.exit
53+
54+
_Z17do_insert_cv_testI5_TreeEvv.exit:
55+
%_First.sroa.2.0.i.i = phi i32* [ %0, %entry ], [ %call3.i.i.i.i.i, %if.then.i.i.i.i.i ]
56+
call void @llvm.dbg.value(metadata i32* %_First.sroa.2.0.i.i, metadata !13, metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64)), !dbg !15
57+
call void undef(%class._Tree_const_iterator* null, i32 0, i32* %_First.sroa.2.0.i.i), !dbg !16
58+
ret i32 0
59+
}
60+
61+
declare void @llvm.dbg.value(metadata, metadata, metadata)
62+
63+
!llvm.dbg.cu = !{!0}
64+
!llvm.module.flags = !{!2, !3, !4, !5}
65+
66+
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 14.0.0 (git@github.com:llvm/llvm-project ffb249520766d4e2ca120c09dae7afa3d64ef81d)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
67+
!1 = !DIFile(filename: "toolchain10279.cpp", directory: "/home/jmorse")
68+
!2 = !{i32 7, !"Dwarf Version", i32 4}
69+
!3 = !{i32 2, !"Debug Info Version", i32 3}
70+
!4 = !{i32 1, !"wchar_size", i32 4}
71+
!5 = !{i32 7, !"uwtable", i32 1}
72+
!6 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 52, type: !7, scopeLine: 52, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
73+
!7 = !DISubroutineType(types: !8)
74+
!8 = !{!9}
75+
!9 = !DIBasicType(name: "int", size: 128, encoding: DW_ATE_signed)
76+
!10 = !DILocalVariable(name: "v1", scope: !11, file: !1, line: 47, type: !9)
77+
!11 = distinct !DILexicalBlock(scope: !6)
78+
!12 = !DILocation(line: 0, scope: !11)
79+
!13 = !DILocalVariable(name: "_First", arg: 1, scope: !14, file: !1, line: 11, type: !9)
80+
!14 = distinct !DILexicalBlock(scope: !6)
81+
!15 = !DILocation(line: 0, scope: !14)
82+
!16 = !DILocation(line: 50, column: 11, scope: !11)
83+
84+
...
85+
---
86+
name: main
87+
alignment: 16
88+
tracksRegLiveness: true
89+
liveins:
90+
- { reg: '$rsi' }
91+
frameInfo:
92+
stackSize: 24
93+
offsetAdjustment: -24
94+
maxAlignment: 1
95+
adjustsStack: true
96+
hasCalls: true
97+
maxCallFrameSize: 0
98+
cvBytesOfCalleeSavedRegisters: 16
99+
fixedStack:
100+
- { id: 0, type: spill-slot, offset: -24, size: 8, alignment: 8, callee-saved-register: '$rbx' }
101+
- { id: 1, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '$r14' }
102+
machineFunctionInfo: {}
103+
body: |
104+
bb.0.entry:
105+
liveins: $rsi, $r14, $rbx
106+
107+
frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp
108+
CFI_INSTRUCTION def_cfa_offset 16
109+
frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp
110+
CFI_INSTRUCTION def_cfa_offset 24
111+
frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp
112+
CFI_INSTRUCTION def_cfa_offset 32
113+
CFI_INSTRUCTION offset $rbx, -24
114+
CFI_INSTRUCTION offset $r14, -16
115+
DBG_PHI $rsi, 2
116+
$rbx = MOV64rr $rsi
117+
DBG_VALUE 2, $noreg, !10, !DIExpression(), debug-location !12
118+
renamable $r14d = XOR32rr undef $r14d, undef $r14d, implicit-def dead $eflags, implicit-def $r14
119+
dead $edi = XOR32rr undef $edi, undef $edi, implicit-def dead $eflags, implicit-def $rdi
120+
CALL64r undef renamable $rax, csr_64, implicit $rsp, implicit $ssp, implicit killed $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def dead $eax, implicit-def dead $rdx
121+
DBG_INSTR_REF 2, 0, !13, !DIExpression(DW_OP_LLVM_fragment, 64, 64), debug-location !15
122+
dead $edi = XOR32rr undef $edi, undef $edi, implicit-def dead $eflags, implicit-def $rdi, debug-location !15
123+
CALL64r undef renamable $rax, csr_64, implicit $rsp, implicit $ssp, implicit killed $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def dead $al, debug-location !15
124+
TEST8rr renamable $r14b, renamable $r14b, implicit-def $eflags, implicit killed $r14
125+
JCC_1 %bb.2, 5, implicit $eflags
126+
127+
bb.1.if.then.i.i.i.i.i:
128+
dead $edi = XOR32rr undef $edi, undef $edi, implicit-def dead $eflags, implicit-def $rdi
129+
CALL64r undef renamable $rax, csr_64, implicit $rsp, implicit $ssp, implicit killed $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def $rax, debug-instr-number 3
130+
$rbx = MOV64rr killed $rax
131+
DBG_INSTR_REF 3, 7, !13, !DIExpression(DW_OP_LLVM_fragment, 64, 64), debug-location !15
132+
133+
bb.2._Z17do_insert_cv_testI5_TreeEvv.exit:
134+
liveins: $rbx
135+
136+
DBG_PHI $rbx, 1
137+
DBG_INSTR_REF 1, 0, !13, !DIExpression(DW_OP_LLVM_fragment, 64, 64), debug-location !15
138+
dead $edi = XOR32rr undef $edi, undef $edi, implicit-def dead $eflags, implicit-def $rdi, debug-location !16
139+
$esi = XOR32rr undef $esi, undef $esi, implicit-def dead $eflags, debug-location !16
140+
$rdx = MOV64rr killed $rbx, debug-location !16
141+
CALL64r undef renamable $rax, csr_64, implicit $rsp, implicit $ssp, implicit killed $rdi, implicit $esi, implicit killed $rdx, implicit-def $rsp, implicit-def $ssp, debug-location !16
142+
$eax = XOR32rr undef $eax, undef $eax, implicit-def dead $eflags
143+
$rsp = frame-destroy ADD64ri8 $rsp, 8, implicit-def dead $eflags
144+
CFI_INSTRUCTION def_cfa_offset 24
145+
$rbx = frame-destroy POP64r implicit-def $rsp, implicit $rsp
146+
CFI_INSTRUCTION def_cfa_offset 16
147+
$r14 = frame-destroy POP64r implicit-def $rsp, implicit $rsp
148+
CFI_INSTRUCTION def_cfa_offset 8
149+
RET64 killed $eax
150+
151+
...

‎llvm/unittests/CodeGen/InstrRefLDVTest.cpp

+20-22
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,9 @@ class InstrRefLDVTest : public testing::Test {
195195
}
196196

197197
bool vlocJoin(MachineBasicBlock &MBB, InstrRefBasedLDV::LiveIdxT &VLOCOutLocs,
198-
SmallPtrSet<const MachineBasicBlock *, 8> &InScopeBlocks,
199198
SmallPtrSet<const MachineBasicBlock *, 8> &BlocksToExplore,
200199
DbgValue &InLoc) {
201-
return LDV->vlocJoin(MBB, VLOCOutLocs, InScopeBlocks, BlocksToExplore,
202-
InLoc);
200+
return LDV->vlocJoin(MBB, VLOCOutLocs, BlocksToExplore, InLoc);
203201
}
204202

205203
void buildVLocValueMap(const DILocation *DILoc,
@@ -2184,14 +2182,14 @@ TEST_F(InstrRefLDVTest, vlocJoinDiamond) {
21842182
DbgValue JoinedLoc = DbgValue(3, EmptyProps, DbgValue::NoVal);
21852183
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
21862184
VLiveOuts[2] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
2187-
bool Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2185+
bool Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, JoinedLoc);
21882186
EXPECT_TRUE(Result); // Output locs should have changed.
21892187
EXPECT_EQ(JoinedLoc.Kind, DbgValue::Def);
21902188
EXPECT_EQ(JoinedLoc.ID, LiveInRsp);
21912189

21922190
// And if we did it a second time, leaving the live-ins as it was, then
21932191
// we should report no change.
2194-
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2192+
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, JoinedLoc);
21952193
EXPECT_FALSE(Result);
21962194

21972195
// If the live-in variable values are different, but there's no PHI placed
@@ -2200,7 +2198,7 @@ TEST_F(InstrRefLDVTest, vlocJoinDiamond) {
22002198
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
22012199
VLiveOuts[2] = DbgValue(LiveInRax, EmptyProps, DbgValue::Def);
22022200
JoinedLoc = DbgValue(3, EmptyProps, DbgValue::NoVal);
2203-
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2201+
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, JoinedLoc);
22042202
EXPECT_TRUE(Result);
22052203
EXPECT_EQ(JoinedLoc.Kind, DbgValue::Def);
22062204
// RPO is blocks 0 2 1 3, so LiveInRax is picked as the first predecessor
@@ -2216,7 +2214,7 @@ TEST_F(InstrRefLDVTest, vlocJoinDiamond) {
22162214
// Try placing a PHI. With differing input values (LiveInRsp, LiveInRax),
22172215
// this PHI should not be eliminated.
22182216
JoinedLoc = DbgValue(3, EmptyProps, DbgValue::VPHI);
2219-
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2217+
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, JoinedLoc);
22202218
// Expect no change.
22212219
EXPECT_FALSE(Result);
22222220
EXPECT_EQ(JoinedLoc.Kind, DbgValue::VPHI);
@@ -2230,7 +2228,7 @@ TEST_F(InstrRefLDVTest, vlocJoinDiamond) {
22302228
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
22312229
VLiveOuts[2] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
22322230
JoinedLoc = DbgValue(3, EmptyProps, DbgValue::VPHI);
2233-
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2231+
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, JoinedLoc);
22342232
EXPECT_TRUE(Result);
22352233
EXPECT_EQ(JoinedLoc.Kind, DbgValue::Def);
22362234
EXPECT_EQ(JoinedLoc.ID, LiveInRsp);
@@ -2242,7 +2240,7 @@ TEST_F(InstrRefLDVTest, vlocJoinDiamond) {
22422240
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
22432241
VLiveOuts[2] = DbgValue(LiveInRax, EmptyProps, DbgValue::Def);
22442242
JoinedLoc = DbgValue(2, EmptyProps, DbgValue::VPHI);
2245-
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2243+
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, JoinedLoc);
22462244
EXPECT_TRUE(Result);
22472245
EXPECT_EQ(JoinedLoc.Kind, DbgValue::Def);
22482246
EXPECT_EQ(JoinedLoc.ID, LiveInRax); // from block 2
@@ -2252,7 +2250,7 @@ TEST_F(InstrRefLDVTest, vlocJoinDiamond) {
22522250
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
22532251
VLiveOuts[2] = DbgValue(0, EmptyProps, DbgValue::VPHI);
22542252
JoinedLoc = DbgValue(2, EmptyProps, DbgValue::VPHI);
2255-
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2253+
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, JoinedLoc);
22562254
EXPECT_TRUE(Result);
22572255
EXPECT_EQ(JoinedLoc.Kind, DbgValue::VPHI);
22582256
EXPECT_EQ(JoinedLoc.BlockNo, 0);
@@ -2262,7 +2260,7 @@ TEST_F(InstrRefLDVTest, vlocJoinDiamond) {
22622260
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
22632261
VLiveOuts[2] = DbgValue(LiveInRsp, PropsWithIndirect, DbgValue::Def);
22642262
JoinedLoc = DbgValue(3, EmptyProps, DbgValue::VPHI);
2265-
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2263+
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, JoinedLoc);
22662264
EXPECT_FALSE(Result);
22672265
EXPECT_EQ(JoinedLoc.Kind, DbgValue::VPHI);
22682266
EXPECT_EQ(JoinedLoc.BlockNo, 3);
@@ -2273,7 +2271,7 @@ TEST_F(InstrRefLDVTest, vlocJoinDiamond) {
22732271
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
22742272
VLiveOuts[2] = DbgValue(LiveInRsp, PropsWithIndirect, DbgValue::Def);
22752273
JoinedLoc = DbgValue(2, EmptyProps, DbgValue::VPHI);
2276-
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2274+
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, JoinedLoc);
22772275
EXPECT_TRUE(Result);
22782276
EXPECT_EQ(JoinedLoc.Kind, DbgValue::Def);
22792277
EXPECT_EQ(JoinedLoc.ID, LiveInRsp);
@@ -2289,7 +2287,7 @@ TEST_F(InstrRefLDVTest, vlocJoinDiamond) {
22892287
VLiveOuts[1] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
22902288
VLiveOuts[2] = DbgValue(LiveInRsp, PropsWithExpr, DbgValue::Def);
22912289
JoinedLoc = DbgValue(3, EmptyProps, DbgValue::VPHI);
2292-
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2290+
Result = vlocJoin(*MBB3, VLiveOutIdx, AllBlocks, JoinedLoc);
22932291
EXPECT_FALSE(Result);
22942292
}
22952293

@@ -2343,7 +2341,7 @@ TEST_F(InstrRefLDVTest, vlocJoinLoops) {
23432341
VLiveOuts[0] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
23442342
VLiveOuts[1] = DbgValue(LiveInRax, EmptyProps, DbgValue::Def);
23452343
DbgValue JoinedLoc = DbgValue(LiveInRax, EmptyProps, DbgValue::Def);
2346-
bool Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2344+
bool Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, JoinedLoc);
23472345
EXPECT_TRUE(Result);
23482346
EXPECT_EQ(JoinedLoc.Kind, DbgValue::Def);
23492347
EXPECT_EQ(JoinedLoc.ID, LiveInRsp);
@@ -2352,7 +2350,7 @@ TEST_F(InstrRefLDVTest, vlocJoinLoops) {
23522350
VLiveOuts[0] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
23532351
VLiveOuts[1] = DbgValue(LiveInRax, EmptyProps, DbgValue::Def);
23542352
JoinedLoc = DbgValue(1, EmptyProps, DbgValue::VPHI);
2355-
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2353+
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, JoinedLoc);
23562354
EXPECT_FALSE(Result);
23572355
EXPECT_EQ(JoinedLoc.Kind, DbgValue::VPHI);
23582356
EXPECT_EQ(JoinedLoc.BlockNo, 1);
@@ -2361,7 +2359,7 @@ TEST_F(InstrRefLDVTest, vlocJoinLoops) {
23612359
VLiveOuts[0] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
23622360
VLiveOuts[1] = DbgValue(1, EmptyProps, DbgValue::VPHI);
23632361
JoinedLoc = DbgValue(1, EmptyProps, DbgValue::VPHI);
2364-
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2362+
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, JoinedLoc);
23652363
EXPECT_TRUE(Result);
23662364
EXPECT_EQ(JoinedLoc.Kind, DbgValue::Def);
23672365
EXPECT_EQ(JoinedLoc.ID, LiveInRsp);
@@ -2374,7 +2372,7 @@ TEST_F(InstrRefLDVTest, vlocJoinLoops) {
23742372
VLiveOuts[0] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
23752373
VLiveOuts[1] = DbgValue(1, PropsWithExpr, DbgValue::VPHI);
23762374
JoinedLoc = DbgValue(1, EmptyProps, DbgValue::VPHI);
2377-
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2375+
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, JoinedLoc);
23782376
EXPECT_FALSE(Result);
23792377
EXPECT_EQ(JoinedLoc.Kind, DbgValue::VPHI);
23802378
EXPECT_EQ(JoinedLoc.BlockNo, 1);
@@ -2383,7 +2381,7 @@ TEST_F(InstrRefLDVTest, vlocJoinLoops) {
23832381
VLiveOuts[0] = DbgValue(LiveInRsp, EmptyProps, DbgValue::Def);
23842382
VLiveOuts[1] = DbgValue(0, EmptyProps, DbgValue::VPHI);
23852383
JoinedLoc = DbgValue(1, EmptyProps, DbgValue::VPHI);
2386-
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2384+
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, JoinedLoc);
23872385
EXPECT_FALSE(Result);
23882386
EXPECT_EQ(JoinedLoc.Kind, DbgValue::VPHI);
23892387
EXPECT_EQ(JoinedLoc.BlockNo, 1);
@@ -2447,7 +2445,7 @@ TEST_F(InstrRefLDVTest, vlocJoinBadlyNestedLoops) {
24472445
VLiveOuts[1] = DbgValue(LiveInRax, EmptyProps, DbgValue::Def);
24482446
VLiveOuts[2] = DbgValue(LiveInRbx, EmptyProps, DbgValue::Def);
24492447
DbgValue JoinedLoc = DbgValue(1, EmptyProps, DbgValue::VPHI);
2450-
bool Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2448+
bool Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, JoinedLoc);
24512449
EXPECT_FALSE(Result);
24522450
EXPECT_EQ(JoinedLoc.Kind, DbgValue::VPHI);
24532451
EXPECT_EQ(JoinedLoc.BlockNo, 1);
@@ -2457,7 +2455,7 @@ TEST_F(InstrRefLDVTest, vlocJoinBadlyNestedLoops) {
24572455
VLiveOuts[1] = DbgValue(1, EmptyProps, DbgValue::VPHI);
24582456
VLiveOuts[2] = DbgValue(1, EmptyProps, DbgValue::VPHI);
24592457
JoinedLoc = DbgValue(1, EmptyProps, DbgValue::VPHI);
2460-
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2458+
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, JoinedLoc);
24612459
EXPECT_TRUE(Result);
24622460
EXPECT_EQ(JoinedLoc.Kind, DbgValue::Def);
24632461
EXPECT_EQ(JoinedLoc.ID, LiveInRsp);
@@ -2468,7 +2466,7 @@ TEST_F(InstrRefLDVTest, vlocJoinBadlyNestedLoops) {
24682466
VLiveOuts[1] = DbgValue(1, EmptyProps, DbgValue::VPHI);
24692467
VLiveOuts[2] = DbgValue(1, PropsWithIndirect, DbgValue::VPHI);
24702468
JoinedLoc = DbgValue(1, EmptyProps, DbgValue::VPHI);
2471-
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2469+
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, JoinedLoc);
24722470
EXPECT_FALSE(Result);
24732471
EXPECT_EQ(JoinedLoc.Kind, DbgValue::VPHI);
24742472
EXPECT_EQ(JoinedLoc.BlockNo, 1);
@@ -2478,7 +2476,7 @@ TEST_F(InstrRefLDVTest, vlocJoinBadlyNestedLoops) {
24782476
VLiveOuts[1] = DbgValue(1, EmptyProps, DbgValue::VPHI);
24792477
VLiveOuts[2] = DbgValue(2, EmptyProps, DbgValue::VPHI);
24802478
JoinedLoc = DbgValue(1, EmptyProps, DbgValue::VPHI);
2481-
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, AllBlocks, JoinedLoc);
2479+
Result = vlocJoin(*MBB1, VLiveOutIdx, AllBlocks, JoinedLoc);
24822480
EXPECT_FALSE(Result);
24832481
EXPECT_EQ(JoinedLoc.Kind, DbgValue::VPHI);
24842482
EXPECT_EQ(JoinedLoc.BlockNo, 1);

0 commit comments

Comments
 (0)