Skip to content

[ARM][NFC] Use addLiveIns method instead of manually adding live-ins #87560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,10 +1025,7 @@ MachineBasicBlock *ARMConstantIslands::splitBlockBeforeInstr(MachineInstr *MI) {
OrigBB->addSuccessor(NewBB);

// Update live-in information in the new block.
MachineRegisterInfo &MRI = MF->getRegInfo();
for (MCPhysReg L : LRs)
if (!MRI.isReserved(L))
NewBB->addLiveIn(L);
addLiveIns(*NewBB, LRs);

// Update internal data structures to account for the newly inserted MBB.
// This is almost the same as updateForInsertedWaterBlock, except that
Expand Down
10 changes: 3 additions & 7 deletions llvm/test/CodeGen/ARM/constant-island-movwt.mir
Original file line number Diff line number Diff line change
Expand Up @@ -898,13 +898,9 @@ body: |
# CHECK-NEXT: CONSTPOOL_ENTRY 1, %const.0, 4
# CHECK-NEXT: {{^ $}}
# CHECK-NEXT: bb.2.entry (align 2):
# CHECK-NEXT: liveins: $d13, $s27, $r10, $r9, $r8, $s26, $d12, $s25, $s24,
# CHECK-SAME: $d15, $s30, $s31, $d14, $s28, $s29, $lr, $r0, $d21,
# CHECK-SAME: $r3, $q10, $d20, $d17, $r2, $d25, $q11, $d22, $d23,
# CHECK-SAME: $r1, $q8, $d16, $s3, $q14, $d28, $d29, $d19, $s17,
# CHECK-SAME: $d8, $s16, $r6, $r7, $r4, $q12, $q9, $d18, $s0, $q15,
# CHECK-SAME: $d30, $d31, $r12, $s1, $d0, $d24, $s2, $d1, $q0, $s6,
# CHECK-SAME: $d3, $d2, $s4, $q1, $s7, $s5, $d9, $s18, $s19, $q4
# CHECK-NEXT: liveins: $d13, $r10, $r9, $r8, $d12, $d15, $d14, $lr, $r0,
# CHECK-SAME: $r3, $q10, $r2, $q11, $r1, $q8, $q14, $r6, $r7,
# CHECK-SAME: $r4, $q12, $q9, $q15, $r12, $q0, $q1, $q4
# CHECK-NEXT: {{^ $}}
# CHECK-NEXT: $r5 = t2MOVi16 target-flags(arm-lo16) @.str.84, 14 /* CC::al */, $noreg
# CHECK-NEXT: $r5 = t2MOVTi16 $r5, target-flags(arm-hi16) @.str.84, 14 /* CC::al */, $noreg
103 changes: 61 additions & 42 deletions llvm/test/CodeGen/ARM/constant-islands-split-IT.mir
Original file line number Diff line number Diff line change
Expand Up @@ -69,48 +69,67 @@ machineFunctionInfo: {}
body: |
; CHECK-LABEL: name: h
; CHECK: bb.0:
; CHECK: successors: %bb.4(0x80000000)
; CHECK: renamable $d0 = VLDRD %const.3, 0, 14 /* CC::al */, $noreg :: (load (s64) from constant-pool)
; CHECK: dead renamable $r0 = SPACE 40, undef renamable $r0
; CHECK: tB %bb.4, 14 /* CC::al */, $noreg
; CHECK: bb.1 (align 8):
; CHECK: successors:
; CHECK: CONSTPOOL_ENTRY 3, %const.0, 8
; CHECK: bb.2:
; CHECK: successors:
; CHECK: bb.3 (align 8):
; CHECK: successors:
; CHECK: CONSTPOOL_ENTRY 5, %const.2, 8
; CHECK: bb.4 (align 2):
; CHECK: successors: %bb.5(0x80000000)
; CHECK: dead renamable $r0 = SPACE 790, undef renamable $r0
; CHECK: bb.5:
; CHECK: successors: %bb.7(0x80000000)
; CHECK: renamable $r0 = t2MOVi 0, 14 /* CC::al */, $noreg, $noreg
; CHECK: t2CMPri $r0, 32, 14 /* CC::al */, $noreg, implicit-def $cpsr
; CHECK: renamable $r0 = SPACE 200, undef renamable $r0
; CHECK: t2IT 0, 1, implicit-def $itstate
; CHECK: renamable $d0 = VLDRD %const.7, 0, 0 /* CC::eq */, $cpsr, implicit $itstate :: (load (s64) from constant-pool)
; CHECK: renamable $d1 = VLDRD %const.5, 0, 0 /* CC::eq */, $cpsr, implicit $itstate :: (load (s64) from constant-pool)
; CHECK: renamable $d2 = VLDRD %const.6, 0, 0 /* CC::eq */, $cpsr, implicit $itstate :: (load (s64) from constant-pool)
; CHECK: $r0 = t2SUBri $r0, 12, 0 /* CC::eq */, $cpsr, $noreg, implicit killed $itstate
; CHECK: t2B %bb.7, 14 /* CC::al */, $noreg
; CHECK: bb.6 (align 8):
; CHECK: successors:
; CHECK: CONSTPOOL_ENTRY 7, %const.1, 8
; CHECK: bb.7 (align 2):
; CHECK: liveins: $r0, $cpsr, $d0, $s0, $s1, $d1, $s2, $s3, $d2, $s4, $s5
; CHECK: t2IT 0, 4, implicit-def $itstate
; CHECK: $sp = tMOVr $r0, 0 /* CC::eq */, $cpsr, implicit $itstate
; CHECK: $sp = t2LDMIA_RET $sp, 0 /* CC::eq */, killed $cpsr, def $r4, def $r5, def $r6, def $r7, def $r8, def $r9, def $r10, def $r11, def $pc, implicit killed $d0, implicit killed $d1, implicit killed $d2, implicit $sp, implicit killed $itstate
; CHECK: bb.8 (align 8):
; CHECK: successors:
; CHECK: CONSTPOOL_ENTRY 6, %const.0, 8
; CHECK: bb.9 (align 2):
; CHECK: successors: %bb.9(0x80000000)
; CHECK: dead renamable $r0 = SPACE 4000, undef renamable $r0
; CHECK: t2B %bb.9, 14 /* CC::al */, $noreg
; CHECK: bb.10:
; CHECK-NEXT: successors: %bb.4(0x80000000)
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: renamable $d0 = VLDRD %const.3, 0, 14 /* CC::al */, $noreg :: (load (s64) from constant-pool)
; CHECK-NEXT: dead renamable $r0 = SPACE 40, undef renamable $r0
; CHECK-NEXT: tB %bb.4, 14 /* CC::al */, $noreg
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.1 (align 8):
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: CONSTPOOL_ENTRY 3, %const.0, 8
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2:
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.3 (align 8):
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: CONSTPOOL_ENTRY 5, %const.2, 8
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.4 (align 2):
; CHECK-NEXT: successors: %bb.5(0x80000000)
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: dead renamable $r0 = SPACE 790, undef renamable $r0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.5:
; CHECK-NEXT: successors: %bb.7(0x80000000)
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: renamable $r0 = t2MOVi 0, 14 /* CC::al */, $noreg, $noreg
; CHECK-NEXT: t2CMPri $r0, 32, 14 /* CC::al */, $noreg, implicit-def $cpsr
; CHECK-NEXT: renamable $r0 = SPACE 200, undef renamable $r0
; CHECK-NEXT: t2IT 0, 1, implicit-def $itstate
; CHECK-NEXT: renamable $d0 = VLDRD %const.7, 0, 0 /* CC::eq */, $cpsr, implicit $itstate :: (load (s64) from constant-pool)
; CHECK-NEXT: renamable $d1 = VLDRD %const.5, 0, 0 /* CC::eq */, $cpsr, implicit $itstate :: (load (s64) from constant-pool)
; CHECK-NEXT: renamable $d2 = VLDRD %const.6, 0, 0 /* CC::eq */, $cpsr, implicit $itstate :: (load (s64) from constant-pool)
; CHECK-NEXT: $r0 = t2SUBri $r0, 12, 0 /* CC::eq */, $cpsr, $noreg, implicit killed $itstate
; CHECK-NEXT: t2B %bb.7, 14 /* CC::al */, $noreg
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.6 (align 8):
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: CONSTPOOL_ENTRY 7, %const.1, 8
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.7 (align 2):
; CHECK-NEXT: liveins: $r0, $cpsr, $d0, $d1, $d2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: t2IT 0, 4, implicit-def $itstate
; CHECK-NEXT: $sp = tMOVr $r0, 0 /* CC::eq */, $cpsr, implicit $itstate
; CHECK-NEXT: $sp = t2LDMIA_RET $sp, 0 /* CC::eq */, killed $cpsr, def $r4, def $r5, def $r6, def $r7, def $r8, def $r9, def $r10, def $r11, def $pc, implicit killed $d0, implicit killed $d1, implicit killed $d2, implicit $sp, implicit killed $itstate
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.8 (align 8):
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: CONSTPOOL_ENTRY 6, %const.0, 8
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.9 (align 2):
; CHECK-NEXT: successors: %bb.9(0x80000000)
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: dead renamable $r0 = SPACE 4000, undef renamable $r0
; CHECK-NEXT: t2B %bb.9, 14 /* CC::al */, $noreg
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.10:
bb.0:
successors: %bb.1(0x80000000)

Expand Down
Loading