[llvm] Reapply "[ARM][NFC] Use addLiveIns method instead of manually adding live ins (#87560)" (PR #96448)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 23 18:07:30 PDT 2024
https://github.com/AtariDreams created https://github.com/llvm/llvm-project/pull/96448
None
>From 3d95666bc335b5b6f1979e3d206f47668a80706d Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Sun, 23 Jun 2024 21:06:06 -0400
Subject: [PATCH] Reapply "[ARM][NFC] Use addLiveIns method instead of manually
adding live-ins (#87560)"
This reverts commit 9378d74e567b1148331d0e91ac82788d122b51b1.
---
llvm/lib/Target/ARM/ARMConstantIslandPass.cpp | 5 +-
.../CodeGen/ARM/constant-island-movwt.mir | 11 +-
.../CodeGen/ARM/constant-islands-split-IT.mir | 103 +++++++++++-------
3 files changed, 65 insertions(+), 54 deletions(-)
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
index 90f5c6c40b49c..c6c152cb6aad8 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 7b3e59eca8472..8e8d73ce22000 100644
--- a/llvm/test/CodeGen/ARM/constant-island-movwt.mir
+++ b/llvm/test/CodeGen/ARM/constant-island-movwt.mir
@@ -898,14 +898,9 @@ body: |
# CHECK-NEXT: CONSTPOOL_ENTRY 1, %const.0, 4
# CHECK-NEXT: {{^ $}}
# CHECK-NEXT: bb.2.entry (align 2):
-# CHECK-NEXT: liveins: $s26, $s27, $r10, $r9, $r8, $d13, $s24, $s25,
-# CHECK-SAME: $d12, $d15, $s30, $s31, $d14, $s28, $s29, $lr,
-# CHECK-SAME: $d21, $q10, $r7, $r0, $d20, $d17, $r2, $q12,
-# CHECK-SAME: $q11, $d22, $d23, $r1, $q8, $d16, $d30, $q14,
-# CHECK-SAME: $d28, $d29, $d19, $s17, $r4, $d8, $r6, $r3,
-# CHECK-SAME: $s16, $d25, $q9, $d18, $s0, $d31, $s3, $q15,
-# CHECK-SAME: $r12, $d0, $s1, $d24, $d1, $s2, $q0, $s5, $d2,
-# CHECK-SAME: $q1, $s4, $s7, $d3, $s6, $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