[llvm] 6e14583 - [ARM][NFC] Use addLiveIns method instead of manually adding live-ins (#87560)
via llvm-commits
llvm-commits at lists.llvm.org
Sun May 26 16:29:33 PDT 2024
Author: AtariDreams
Date: 2024-05-26T19:29:29-04:00
New Revision: 6e14583c53c8b1950e502a7fa282d7e00ad2df4a
URL: https://github.com/llvm/llvm-project/commit/6e14583c53c8b1950e502a7fa282d7e00ad2df4a
DIFF: https://github.com/llvm/llvm-project/commit/6e14583c53c8b1950e502a7fa282d7e00ad2df4a.diff
LOG: [ARM][NFC] Use addLiveIns method instead of manually adding live-ins (#87560)
Do this instead of reimplementing addLiveIns which does the exact same thing.
Added:
Modified:
llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
llvm/test/CodeGen/ARM/constant-island-movwt.mir
llvm/test/CodeGen/ARM/constant-islands-split-IT.mir
Removed:
################################################################################
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
index 9579053943f9f..54de202b64a54 100644
--- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -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
diff --git a/llvm/test/CodeGen/ARM/constant-island-movwt.mir b/llvm/test/CodeGen/ARM/constant-island-movwt.mir
index 7d21a4e4875c3..8e8d73ce22000 100644
--- a/llvm/test/CodeGen/ARM/constant-island-movwt.mir
+++ b/llvm/test/CodeGen/ARM/constant-island-movwt.mir
@@ -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
diff --git a/llvm/test/CodeGen/ARM/constant-islands-split-IT.mir b/llvm/test/CodeGen/ARM/constant-islands-split-IT.mir
index 85fd2d610b1e6..a1a96614a15f6 100644
--- a/llvm/test/CodeGen/ARM/constant-islands-split-IT.mir
+++ b/llvm/test/CodeGen/ARM/constant-islands-split-IT.mir
@@ -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)
More information about the llvm-commits
mailing list