Skip to content

Commit 5386886

Browse files
committed
Avoid adding duplicate implicit-defs
1 parent ca943df commit 5386886

File tree

4 files changed

+83
-84
lines changed

4 files changed

+83
-84
lines changed

llvm/lib/CodeGen/RegisterCoalescer.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,15 +1970,17 @@ void RegisterCoalescer::updateRegDefsUses(
19701970
// because the undef means that none of the bits of %1 are read, thus
19711971
// thrashing the top 24 bits of %1.sub32.
19721972
if (SubregToRegSrcInsts->contains(UseMI) &&
1973-
all_of(UseMI->defs(), [&SubIdx](const MachineOperand &MO) -> bool {
1974-
if (MO.isUndef())
1975-
return true;
1976-
return SubIdx && (!MO.getSubReg() || SubIdx == MO.getSubReg());
1977-
})) {
1973+
all_of(UseMI->all_defs(),
1974+
[&SubIdx, &SrcReg](const MachineOperand &MO) -> bool {
1975+
if (MO.getReg() != SrcReg) // Ignore unrelated registers
1976+
return true;
1977+
return MO.isUndef() ||
1978+
(SubIdx &&
1979+
(!MO.getSubReg() || SubIdx == MO.getSubReg()));
1980+
})) {
19781981
// Add implicit-def of super-register to express that the whole
19791982
// register is defined by the instruction.
1980-
MachineInstrBuilder MIB(*MF, UseMI);
1981-
MIB.addReg(DstReg, RegState::ImplicitDefine);
1983+
UseMI->addRegisterDefined(DstReg);
19821984
RequiresImplicitRedef = true;
19831985
}
19841986

llvm/test/CodeGen/AArch64/arm64-neon-copy.ll

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,7 @@ define <16 x i8> @test_concat_v16i8_v8i8_v16i8(<8 x i8> %x, <16 x i8> %y) #0 {
17271727
; CHECK-GI-LABEL: test_concat_v16i8_v8i8_v16i8:
17281728
; CHECK-GI: // %bb.0: // %entry
17291729
; CHECK-GI-NEXT: mov v2.16b, v1.16b
1730-
; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0 def $q0 def $q0 def $q0 def $q0 def $q0 def $q0 def $q0
1730+
; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
17311731
; CHECK-GI-NEXT: adrp x8, .LCPI127_0
17321732
; CHECK-GI-NEXT: mov v1.b[0], v0.b[0]
17331733
; CHECK-GI-NEXT: mov v1.b[1], v0.b[1]
@@ -1771,7 +1771,7 @@ define <16 x i8> @test_concat_v16i8_v16i8_v8i8(<16 x i8> %x, <8 x i8> %y) #0 {
17711771
; CHECK-GI-LABEL: test_concat_v16i8_v16i8_v8i8:
17721772
; CHECK-GI: // %bb.0: // %entry
17731773
; CHECK-GI-NEXT: mov b2, v0.b[0]
1774-
; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1 def $q1 def $q1 def $q1 def $q1 def $q1 def $q1 def $q1
1774+
; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
17751775
; CHECK-GI-NEXT: mov v2.b[1], v0.b[1]
17761776
; CHECK-GI-NEXT: mov v2.b[2], v0.b[2]
17771777
; CHECK-GI-NEXT: mov v2.b[3], v0.b[3]
@@ -1835,9 +1835,9 @@ define <16 x i8> @test_concat_v16i8_v8i8_v8i8(<8 x i8> %x, <8 x i8> %y) #0 {
18351835
;
18361836
; CHECK-GI-LABEL: test_concat_v16i8_v8i8_v8i8:
18371837
; CHECK-GI: // %bb.0: // %entry
1838-
; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0 def $q0 def $q0 def $q0 def $q0 def $q0 def $q0 def $q0
1838+
; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
18391839
; CHECK-GI-NEXT: mov v2.b[0], v0.b[0]
1840-
; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1 def $q1 def $q1 def $q1 def $q1 def $q1 def $q1 def $q1
1840+
; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
18411841
; CHECK-GI-NEXT: mov v2.b[1], v0.b[1]
18421842
; CHECK-GI-NEXT: mov v2.b[2], v0.b[2]
18431843
; CHECK-GI-NEXT: mov v2.b[3], v0.b[3]
@@ -1920,7 +1920,7 @@ define <8 x i16> @test_concat_v8i16_v4i16_v8i16(<4 x i16> %x, <8 x i16> %y) #0 {
19201920
; CHECK-GI-LABEL: test_concat_v8i16_v4i16_v8i16:
19211921
; CHECK-GI: // %bb.0: // %entry
19221922
; CHECK-GI-NEXT: mov v2.16b, v1.16b
1923-
; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0 def $q0 def $q0 def $q0
1923+
; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
19241924
; CHECK-GI-NEXT: adrp x8, .LCPI131_0
19251925
; CHECK-GI-NEXT: mov v1.h[0], v0.h[0]
19261926
; CHECK-GI-NEXT: mov v1.h[1], v0.h[1]
@@ -1952,7 +1952,7 @@ define <8 x i16> @test_concat_v8i16_v8i16_v4i16(<8 x i16> %x, <4 x i16> %y) #0 {
19521952
; CHECK-GI-LABEL: test_concat_v8i16_v8i16_v4i16:
19531953
; CHECK-GI: // %bb.0: // %entry
19541954
; CHECK-GI-NEXT: mov h2, v0.h[0]
1955-
; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1 def $q1 def $q1 def $q1
1955+
; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
19561956
; CHECK-GI-NEXT: mov v2.h[1], v0.h[1]
19571957
; CHECK-GI-NEXT: mov v2.h[2], v0.h[2]
19581958
; CHECK-GI-NEXT: mov v2.h[3], v0.h[3]
@@ -1992,9 +1992,9 @@ define <8 x i16> @test_concat_v8i16_v4i16_v4i16(<4 x i16> %x, <4 x i16> %y) #0 {
19921992
;
19931993
; CHECK-GI-LABEL: test_concat_v8i16_v4i16_v4i16:
19941994
; CHECK-GI: // %bb.0: // %entry
1995-
; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0 def $q0 def $q0 def $q0
1995+
; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
19961996
; CHECK-GI-NEXT: mov v2.h[0], v0.h[0]
1997-
; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1 def $q1 def $q1 def $q1
1997+
; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
19981998
; CHECK-GI-NEXT: mov v2.h[1], v0.h[1]
19991999
; CHECK-GI-NEXT: mov v2.h[2], v0.h[2]
20002000
; CHECK-GI-NEXT: mov v2.h[3], v0.h[3]
@@ -2053,7 +2053,7 @@ define <4 x i32> @test_concat_v4i32_v2i32_v4i32(<2 x i32> %x, <4 x i32> %y) #0 {
20532053
; CHECK-GI-LABEL: test_concat_v4i32_v2i32_v4i32:
20542054
; CHECK-GI: // %bb.0: // %entry
20552055
; CHECK-GI-NEXT: mov v2.16b, v1.16b
2056-
; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0 def $q0
2056+
; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
20572057
; CHECK-GI-NEXT: adrp x8, .LCPI135_0
20582058
; CHECK-GI-NEXT: mov v1.s[0], v0.s[0]
20592059
; CHECK-GI-NEXT: mov v1.s[1], v0.s[1]
@@ -2079,7 +2079,7 @@ define <4 x i32> @test_concat_v4i32_v4i32_v2i32(<4 x i32> %x, <2 x i32> %y) #0 {
20792079
; CHECK-GI-LABEL: test_concat_v4i32_v4i32_v2i32:
20802080
; CHECK-GI: // %bb.0: // %entry
20812081
; CHECK-GI-NEXT: mov s2, v0.s[0]
2082-
; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1 def $q1
2082+
; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
20832083
; CHECK-GI-NEXT: mov v2.s[1], v0.s[1]
20842084
; CHECK-GI-NEXT: mov v2.s[2], v1.s[0]
20852085
; CHECK-GI-NEXT: mov v2.s[3], v1.s[1]

llvm/test/CodeGen/AArch64/pr164181.ll

Lines changed: 60 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ define void @f(i1 %var_0, i16 %var_1, i64 %var_2, i8 %var_3, i16 %var_4, i1 %var
2929
; CHECK-NEXT: str w4, [sp, #72] // 4-byte Spill
3030
; CHECK-NEXT: str w3, [sp, #112] // 4-byte Spill
3131
; CHECK-NEXT: str w5, [sp, #36] // 4-byte Spill
32-
; CHECK-NEXT: tbz w5, #0, .LBB0_44
32+
; CHECK-NEXT: tbz w5, #0, .LBB0_43
3333
; CHECK-NEXT: // %bb.1: // %for.body41.lr.ph
3434
; CHECK-NEXT: ldr x4, [sp, #312]
3535
; CHECK-NEXT: ldr x14, [sp, #280]
36-
; CHECK-NEXT: tbz w0, #0, .LBB0_43
36+
; CHECK-NEXT: tbz w0, #0, .LBB0_42
3737
; CHECK-NEXT: // %bb.2: // %for.body41.us.preheader
3838
; CHECK-NEXT: ldrb w8, [sp, #368]
3939
; CHECK-NEXT: ldrb w12, [sp, #256]
@@ -91,8 +91,8 @@ define void @f(i1 %var_0, i16 %var_1, i64 %var_2, i8 %var_3, i16 %var_4, i1 %var
9191
; CHECK-NEXT: // Child Loop BB0_8 Depth 3
9292
; CHECK-NEXT: // Child Loop BB0_10 Depth 4
9393
; CHECK-NEXT: // Child Loop BB0_11 Depth 5
94-
; CHECK-NEXT: // Child Loop BB0_27 Depth 5
95-
; CHECK-NEXT: // Child Loop BB0_40 Depth 5
94+
; CHECK-NEXT: // Child Loop BB0_28 Depth 5
95+
; CHECK-NEXT: // Child Loop BB0_39 Depth 5
9696
; CHECK-NEXT: ldr w8, [sp, #20] // 4-byte Reload
9797
; CHECK-NEXT: mov x12, x24
9898
; CHECK-NEXT: str x24, [sp, #48] // 8-byte Spill
@@ -116,8 +116,8 @@ define void @f(i1 %var_0, i16 %var_1, i64 %var_2, i8 %var_3, i16 %var_4, i1 %var
116116
; CHECK-NEXT: // Child Loop BB0_8 Depth 3
117117
; CHECK-NEXT: // Child Loop BB0_10 Depth 4
118118
; CHECK-NEXT: // Child Loop BB0_11 Depth 5
119-
; CHECK-NEXT: // Child Loop BB0_27 Depth 5
120-
; CHECK-NEXT: // Child Loop BB0_40 Depth 5
119+
; CHECK-NEXT: // Child Loop BB0_28 Depth 5
120+
; CHECK-NEXT: // Child Loop BB0_39 Depth 5
121121
; CHECK-NEXT: str x12, [sp, #40] // 8-byte Spill
122122
; CHECK-NEXT: cmn x24, #30
123123
; CHECK-NEXT: mov x12, #-30 // =0xffffffffffffffe2
@@ -141,8 +141,8 @@ define void @f(i1 %var_0, i16 %var_1, i64 %var_2, i8 %var_3, i16 %var_4, i1 %var
141141
; CHECK-NEXT: // => This Loop Header: Depth=3
142142
; CHECK-NEXT: // Child Loop BB0_10 Depth 4
143143
; CHECK-NEXT: // Child Loop BB0_11 Depth 5
144-
; CHECK-NEXT: // Child Loop BB0_27 Depth 5
145-
; CHECK-NEXT: // Child Loop BB0_40 Depth 5
144+
; CHECK-NEXT: // Child Loop BB0_28 Depth 5
145+
; CHECK-NEXT: // Child Loop BB0_39 Depth 5
146146
; CHECK-NEXT: ldr x8, [sp, #64] // 8-byte Reload
147147
; CHECK-NEXT: mov w14, #1152 // =0x480
148148
; CHECK-NEXT: mov w24, #1 // =0x1
@@ -175,8 +175,8 @@ define void @f(i1 %var_0, i16 %var_1, i64 %var_2, i8 %var_3, i16 %var_4, i1 %var
175175
; CHECK-NEXT: // Parent Loop BB0_8 Depth=3
176176
; CHECK-NEXT: // => This Loop Header: Depth=4
177177
; CHECK-NEXT: // Child Loop BB0_11 Depth 5
178-
; CHECK-NEXT: // Child Loop BB0_27 Depth 5
179-
; CHECK-NEXT: // Child Loop BB0_40 Depth 5
178+
; CHECK-NEXT: // Child Loop BB0_28 Depth 5
179+
; CHECK-NEXT: // Child Loop BB0_39 Depth 5
180180
; CHECK-NEXT: ldr w8, [sp, #116] // 4-byte Reload
181181
; CHECK-NEXT: and w8, w8, w8, asr #31
182182
; CHECK-NEXT: str w8, [sp, #128] // 4-byte Spill
@@ -259,84 +259,81 @@ define void @f(i1 %var_0, i16 %var_1, i64 %var_2, i8 %var_3, i16 %var_4, i1 %var
259259
; CHECK-NEXT: .LBB0_24: // %if.end.us.7
260260
; CHECK-NEXT: // in Loop: Header=BB0_10 Depth=4
261261
; CHECK-NEXT: mov x23, xzr
262-
; CHECK-NEXT: b .LBB0_27
262+
; CHECK-NEXT: b .LBB0_28
263263
; CHECK-NEXT: .p2align 5, , 16
264-
; CHECK-NEXT: .LBB0_25: // in Loop: Header=BB0_27 Depth=5
265-
; CHECK-NEXT: mov w8, #1 // =0x1
266-
; CHECK-NEXT: .LBB0_26: // %for.inc371.us
267-
; CHECK-NEXT: // in Loop: Header=BB0_27 Depth=5
264+
; CHECK-NEXT: .LBB0_25: // %cond.true331.us
265+
; CHECK-NEXT: // in Loop: Header=BB0_28 Depth=5
266+
; CHECK-NEXT: ldrsb w4, [x10]
267+
; CHECK-NEXT: .LBB0_26: // %cond.end345.us
268+
; CHECK-NEXT: // in Loop: Header=BB0_28 Depth=5
269+
; CHECK-NEXT: strh w4, [x18]
270+
; CHECK-NEXT: mul x4, x22, x28
271+
; CHECK-NEXT: adrp x22, :got:var_46
272+
; CHECK-NEXT: mov x8, xzr
273+
; CHECK-NEXT: ldr x22, [x22, :got_lo12:var_46]
274+
; CHECK-NEXT: str x4, [x22]
275+
; CHECK-NEXT: mov x4, #-18403 // =0xffffffffffffb81d
276+
; CHECK-NEXT: movk x4, #58909, lsl #16
277+
; CHECK-NEXT: .LBB0_27: // %for.inc371.us
278+
; CHECK-NEXT: // in Loop: Header=BB0_28 Depth=5
268279
; CHECK-NEXT: mov w22, #-18978 // =0xffffb5de
269280
; CHECK-NEXT: orr x23, x23, #0x1
270281
; CHECK-NEXT: mov x24, xzr
271282
; CHECK-NEXT: mul w12, w12, w22
272283
; CHECK-NEXT: mov x22, x5
273-
; CHECK-NEXT: tbz w0, #0, .LBB0_37
274-
; CHECK-NEXT: .LBB0_27: // %for.body194.us
284+
; CHECK-NEXT: tbz w0, #0, .LBB0_36
285+
; CHECK-NEXT: .LBB0_28: // %for.body194.us
275286
; CHECK-NEXT: // Parent Loop BB0_4 Depth=1
276287
; CHECK-NEXT: // Parent Loop BB0_6 Depth=2
277288
; CHECK-NEXT: // Parent Loop BB0_8 Depth=3
278289
; CHECK-NEXT: // Parent Loop BB0_10 Depth=4
279290
; CHECK-NEXT: // => This Inner Loop Header: Depth=5
280-
; CHECK-NEXT: cbnz wzr, .LBB0_29
281-
; CHECK-NEXT: // %bb.28: // %if.then222.us
282-
; CHECK-NEXT: // in Loop: Header=BB0_27 Depth=5
291+
; CHECK-NEXT: cbnz wzr, .LBB0_30
292+
; CHECK-NEXT: // %bb.29: // %if.then222.us
293+
; CHECK-NEXT: // in Loop: Header=BB0_28 Depth=5
283294
; CHECK-NEXT: adrp x27, :got:var_32
284295
; CHECK-NEXT: ldur w8, [x19, #-12]
285296
; CHECK-NEXT: ldr x27, [x27, :got_lo12:var_32]
286297
; CHECK-NEXT: strh w8, [x27]
287298
; CHECK-NEXT: sxtb w8, w25
288299
; CHECK-NEXT: bic w25, w8, w8, asr #31
289-
; CHECK-NEXT: b .LBB0_30
300+
; CHECK-NEXT: b .LBB0_31
290301
; CHECK-NEXT: .p2align 5, , 16
291-
; CHECK-NEXT: .LBB0_29: // in Loop: Header=BB0_27 Depth=5
302+
; CHECK-NEXT: .LBB0_30: // in Loop: Header=BB0_28 Depth=5
292303
; CHECK-NEXT: mov w25, wzr
293-
; CHECK-NEXT: .LBB0_30: // %if.end239.us
294-
; CHECK-NEXT: // in Loop: Header=BB0_27 Depth=5
304+
; CHECK-NEXT: .LBB0_31: // %if.end239.us
305+
; CHECK-NEXT: // in Loop: Header=BB0_28 Depth=5
295306
; CHECK-NEXT: strb w3, [x16]
296307
; CHECK-NEXT: tst w13, #0xff
297-
; CHECK-NEXT: b.eq .LBB0_32
298-
; CHECK-NEXT: // %bb.31: // %if.then254.us
299-
; CHECK-NEXT: // in Loop: Header=BB0_27 Depth=5
308+
; CHECK-NEXT: b.eq .LBB0_33
309+
; CHECK-NEXT: // %bb.32: // %if.then254.us
310+
; CHECK-NEXT: // in Loop: Header=BB0_28 Depth=5
300311
; CHECK-NEXT: ldrh w8, [x26, x14, lsl #1]
301312
; CHECK-NEXT: adrp x27, :got:var_35
302313
; CHECK-NEXT: ldr x27, [x27, :got_lo12:var_35]
303314
; CHECK-NEXT: cmp w8, #0
304315
; CHECK-NEXT: csel x8, xzr, x7, eq
305316
; CHECK-NEXT: str x8, [x27]
306317
; CHECK-NEXT: strh w1, [x17]
307-
; CHECK-NEXT: .LBB0_32: // %if.end282.us
308-
; CHECK-NEXT: // in Loop: Header=BB0_27 Depth=5
318+
; CHECK-NEXT: .LBB0_33: // %if.end282.us
319+
; CHECK-NEXT: // in Loop: Header=BB0_28 Depth=5
309320
; CHECK-NEXT: orr x27, x24, x4
310321
; CHECK-NEXT: adrp x8, :got:var_39
311322
; CHECK-NEXT: str x27, [x18]
312323
; CHECK-NEXT: ldr x8, [x8, :got_lo12:var_39]
313324
; CHECK-NEXT: str x10, [x8]
314325
; CHECK-NEXT: ldrb w8, [x6, x9]
315326
; CHECK-NEXT: str x8, [x18]
316-
; CHECK-NEXT: cbnz x2, .LBB0_25
317-
; CHECK-NEXT: // %bb.33: // %if.then327.us
318-
; CHECK-NEXT: // in Loop: Header=BB0_27 Depth=5
319327
; CHECK-NEXT: mov w8, #1 // =0x1
320-
; CHECK-NEXT: cbnz w8, .LBB0_35
321-
; CHECK-NEXT: // %bb.34: // %cond.true331.us
322-
; CHECK-NEXT: // in Loop: Header=BB0_27 Depth=5
323-
; CHECK-NEXT: ldrsb w4, [x10]
324-
; CHECK-NEXT: b .LBB0_36
325-
; CHECK-NEXT: .LBB0_35: // in Loop: Header=BB0_27 Depth=5
328+
; CHECK-NEXT: cbnz x2, .LBB0_27
329+
; CHECK-NEXT: // %bb.34: // %if.then327.us
330+
; CHECK-NEXT: // in Loop: Header=BB0_28 Depth=5
331+
; CHECK-NEXT: cbz w8, .LBB0_25
332+
; CHECK-NEXT: // %bb.35: // in Loop: Header=BB0_28 Depth=5
326333
; CHECK-NEXT: mov w4, wzr
327-
; CHECK-NEXT: .LBB0_36: // %cond.end345.us
328-
; CHECK-NEXT: // in Loop: Header=BB0_27 Depth=5
329-
; CHECK-NEXT: strh w4, [x18]
330-
; CHECK-NEXT: mul x4, x22, x28
331-
; CHECK-NEXT: adrp x22, :got:var_46
332-
; CHECK-NEXT: mov x8, xzr
333-
; CHECK-NEXT: ldr x22, [x22, :got_lo12:var_46]
334-
; CHECK-NEXT: str x4, [x22]
335-
; CHECK-NEXT: mov x4, #-18403 // =0xffffffffffffb81d
336-
; CHECK-NEXT: movk x4, #58909, lsl #16
337334
; CHECK-NEXT: b .LBB0_26
338335
; CHECK-NEXT: .p2align 5, , 16
339-
; CHECK-NEXT: .LBB0_37: // %for.cond376.preheader.us
336+
; CHECK-NEXT: .LBB0_36: // %for.cond376.preheader.us
340337
; CHECK-NEXT: // in Loop: Header=BB0_10 Depth=4
341338
; CHECK-NEXT: mov w3, #1152 // =0x480
342339
; CHECK-NEXT: mov x22, xzr
@@ -347,24 +344,24 @@ define void @f(i1 %var_0, i16 %var_1, i64 %var_2, i8 %var_3, i16 %var_4, i1 %var
347344
; CHECK-NEXT: madd x14, x14, x3, x11
348345
; CHECK-NEXT: mov w28, w30
349346
; CHECK-NEXT: mov w3, #-7680 // =0xffffe200
350-
; CHECK-NEXT: b .LBB0_40
347+
; CHECK-NEXT: b .LBB0_39
351348
; CHECK-NEXT: .p2align 5, , 16
352-
; CHECK-NEXT: .LBB0_38: // %if.then466.us
353-
; CHECK-NEXT: // in Loop: Header=BB0_40 Depth=5
349+
; CHECK-NEXT: .LBB0_37: // %if.then466.us
350+
; CHECK-NEXT: // in Loop: Header=BB0_39 Depth=5
354351
; CHECK-NEXT: ldr x28, [sp, #152] // 8-byte Reload
355352
; CHECK-NEXT: ldr x3, [sp, #136] // 8-byte Reload
356353
; CHECK-NEXT: sxtb w4, w4
357354
; CHECK-NEXT: bic w4, w4, w4, asr #31
358355
; CHECK-NEXT: str x3, [x28]
359356
; CHECK-NEXT: mov w3, #-7680 // =0xffffe200
360-
; CHECK-NEXT: .LBB0_39: // %for.inc505.us
361-
; CHECK-NEXT: // in Loop: Header=BB0_40 Depth=5
357+
; CHECK-NEXT: .LBB0_38: // %for.inc505.us
358+
; CHECK-NEXT: // in Loop: Header=BB0_39 Depth=5
362359
; CHECK-NEXT: add x22, x22, #1
363360
; CHECK-NEXT: add x27, x27, #1
364361
; CHECK-NEXT: mov w28, wzr
365362
; CHECK-NEXT: cmp x27, #0
366363
; CHECK-NEXT: b.hs .LBB0_9
367-
; CHECK-NEXT: .LBB0_40: // %for.body380.us
364+
; CHECK-NEXT: .LBB0_39: // %for.body380.us
368365
; CHECK-NEXT: // Parent Loop BB0_4 Depth=1
369366
; CHECK-NEXT: // Parent Loop BB0_6 Depth=2
370367
; CHECK-NEXT: // Parent Loop BB0_8 Depth=3
@@ -376,18 +373,18 @@ define void @f(i1 %var_0, i16 %var_1, i64 %var_2, i8 %var_3, i16 %var_4, i1 %var
376373
; CHECK-NEXT: strh w28, [x11]
377374
; CHECK-NEXT: csel w28, w21, w3, ne
378375
; CHECK-NEXT: str w28, [x20]
379-
; CHECK-NEXT: cbz x15, .LBB0_39
380-
; CHECK-NEXT: // %bb.41: // %if.then436.us
381-
; CHECK-NEXT: // in Loop: Header=BB0_40 Depth=5
376+
; CHECK-NEXT: cbz x15, .LBB0_38
377+
; CHECK-NEXT: // %bb.40: // %if.then436.us
378+
; CHECK-NEXT: // in Loop: Header=BB0_39 Depth=5
382379
; CHECK-NEXT: ldrh w28, [x14]
383-
; CHECK-NEXT: cbnz w28, .LBB0_38
384-
; CHECK-NEXT: // %bb.42: // in Loop: Header=BB0_40 Depth=5
380+
; CHECK-NEXT: cbnz w28, .LBB0_37
381+
; CHECK-NEXT: // %bb.41: // in Loop: Header=BB0_39 Depth=5
385382
; CHECK-NEXT: mov w4, wzr
386-
; CHECK-NEXT: b .LBB0_39
387-
; CHECK-NEXT: .LBB0_43: // %for.body41
383+
; CHECK-NEXT: b .LBB0_38
384+
; CHECK-NEXT: .LBB0_42: // %for.body41
388385
; CHECK-NEXT: strb wzr, [x4]
389386
; CHECK-NEXT: strb wzr, [x14]
390-
; CHECK-NEXT: .LBB0_44: // %for.cond563.preheader
387+
; CHECK-NEXT: .LBB0_43: // %for.cond563.preheader
391388
; CHECK-NEXT: ldp x20, x19, [sp, #224] // 16-byte Folded Reload
392389
; CHECK-NEXT: ldp x22, x21, [sp, #208] // 16-byte Folded Reload
393390
; CHECK-NEXT: ldp x24, x23, [sp, #192] // 16-byte Folded Reload

llvm/test/CodeGen/X86/subreg-to-reg-coalescing.mir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ body: |
8686
bb.0:
8787
; CHECK-LABEL: name: coalesce_mov32r0_into_subreg_def_with_super_def_to_reg64
8888
; CHECK: ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
89-
; CHECK-NEXT: undef [[MOV32r0_:%[0-9]+]].sub_32bit:gr64_with_sub_8bit = MOV32r0 implicit-def dead $eflags, implicit-def [[MOV32r0_]], implicit-def [[MOV32r0_]]
90-
; CHECK-NEXT: dead $edi = MOV32r0 implicit-def dead $eflags, implicit-def $rdi, implicit-def $rdi
89+
; CHECK-NEXT: undef [[MOV32r0_:%[0-9]+]].sub_32bit:gr64_with_sub_8bit = MOV32r0 implicit-def dead $eflags, implicit-def [[MOV32r0_]]
90+
; CHECK-NEXT: dead $edi = MOV32r0 implicit-def dead $eflags, implicit-def $rdi
9191
; CHECK-NEXT: CALL64r [[MOV32r0_]], csr_64, implicit $rsp, implicit $ssp, implicit killed $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def dead $rax
9292
; CHECK-NEXT: ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
9393
; CHECK-NEXT: RET 0
@@ -139,8 +139,8 @@ body: |
139139
; CHECK-NEXT: liveins: $rdi
140140
; CHECK-NEXT: {{ $}}
141141
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
142-
; CHECK-NEXT: undef [[MOV32r0_:%[0-9]+]].sub_32bit:gr64_with_sub_8bit = MOV32r0 implicit-def dead $eflags, implicit-def [[MOV32r0_]], implicit-def [[MOV32r0_]]
143-
; CHECK-NEXT: undef [[MOV32r0_1:%[0-9]+]].sub_32bit:gr64_with_sub_8bit = MOV32r0 implicit-def dead $eflags, implicit-def [[MOV32r0_1]], implicit-def [[MOV32r0_1]]
142+
; CHECK-NEXT: undef [[MOV32r0_:%[0-9]+]].sub_32bit:gr64_with_sub_8bit = MOV32r0 implicit-def dead $eflags, implicit-def [[MOV32r0_]]
143+
; CHECK-NEXT: undef [[MOV32r0_1:%[0-9]+]].sub_32bit:gr64_with_sub_8bit = MOV32r0 implicit-def dead $eflags, implicit-def [[MOV32r0_1]]
144144
; CHECK-NEXT: {{ $}}
145145
; CHECK-NEXT: bb.1:
146146
; CHECK-NEXT: successors: %bb.1(0x80000000)

0 commit comments

Comments
 (0)