Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 20774fe

Browse files
committedJan 31, 2024
[MIRPrinter] Don't print line break when there is no instructions
1 parent b7738e2 commit 20774fe

File tree

50 files changed

+144
-321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+144
-321
lines changed
 

‎llvm/lib/CodeGen/MIRPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ void MIPrinter::print(const MachineBasicBlock &MBB) {
728728
HasLineAttributes = true;
729729
}
730730

731-
if (HasLineAttributes)
731+
if (HasLineAttributes && !MBB.instrs().empty())
732732
OS << "\n";
733733
bool IsInBundle = false;
734734
for (const MachineInstr &MI : MBB.instrs()) {

‎llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator-switch.ll

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ define i32 @test_cfg_remap_multiple_preds(i32 %in) {
136136
; CHECK-NEXT: {{ $}}
137137
; CHECK-NEXT: bb.2.odd:
138138
; CHECK-NEXT: successors:
139-
; CHECK: {{ $}}
140-
; CHECK: {{ $}}
141-
; CHECK: bb.3.next:
139+
; CHECK-NEXT: {{ $}}
140+
; CHECK-NEXT: bb.3.next:
142141
; CHECK-NEXT: G_BR %bb.5
143142
; CHECK-NEXT: {{ $}}
144143
; CHECK-NEXT: bb.4.other:
@@ -1147,25 +1146,20 @@ define void @jt_2_tables_phi_edge_from_second() {
11471146
; CHECK-NEXT: {{ $}}
11481147
; CHECK-NEXT: bb.2.if.then:
11491148
; CHECK-NEXT: successors:
1150-
; CHECK: {{ $}}
1151-
; CHECK: {{ $}}
1152-
; CHECK: bb.3.sw.bb2.i41:
1149+
; CHECK-NEXT: {{ $}}
1150+
; CHECK-NEXT: bb.3.sw.bb2.i41:
1151+
; CHECK-NEXT: successors:
1152+
; CHECK-NEXT: {{ $}}
1153+
; CHECK-NEXT: bb.4.sw.bb7.i44:
11531154
; CHECK-NEXT: successors:
1154-
; CHECK: {{ $}}
1155-
; CHECK: {{ $}}
1156-
; CHECK: bb.4.sw.bb7.i44:
1155+
; CHECK-NEXT: {{ $}}
1156+
; CHECK-NEXT: bb.5.sw.bb8.i45:
11571157
; CHECK-NEXT: successors:
1158-
; CHECK: {{ $}}
1159-
; CHECK: {{ $}}
1160-
; CHECK: bb.5.sw.bb8.i45:
1158+
; CHECK-NEXT: {{ $}}
1159+
; CHECK-NEXT: bb.6.sw.bb13.i47:
11611160
; CHECK-NEXT: successors:
1162-
; CHECK: {{ $}}
1163-
; CHECK: {{ $}}
1164-
; CHECK: bb.6.sw.bb13.i47:
1165-
; CHECK: successors:
1166-
; CHECK: {{ $}}
1167-
; CHECK: {{ $}}
1168-
; CHECK: bb.7.sw.bb14.i48:
1161+
; CHECK-NEXT: {{ $}}
1162+
; CHECK-NEXT: bb.7.sw.bb14.i48:
11691163
; CHECK-NEXT: [[ICMP5:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C5]]
11701164
; CHECK-NEXT: G_BRCOND [[ICMP5]](s1), %bb.10
11711165
; CHECK-NEXT: G_BR %bb.24
@@ -1207,9 +1201,8 @@ define void @jt_2_tables_phi_edge_from_second() {
12071201
; CHECK-NEXT: {{ $}}
12081202
; CHECK-NEXT: bb.8.sw.default.i49:
12091203
; CHECK-NEXT: successors:
1210-
; CHECK: {{ $}}
1211-
; CHECK: {{ $}}
1212-
; CHECK: bb.9.sw.bb1.i:
1204+
; CHECK-NEXT: {{ $}}
1205+
; CHECK-NEXT: bb.9.sw.bb1.i:
12131206
; CHECK-NEXT: G_BR %bb.16
12141207
; CHECK-NEXT: {{ $}}
12151208
; CHECK-NEXT: bb.10.sw.bb4.i:
@@ -1237,8 +1230,8 @@ define void @jt_2_tables_phi_edge_from_second() {
12371230
; CHECK-NEXT: {{ $}}
12381231
; CHECK-NEXT: bb.17.while.body:
12391232
; CHECK-NEXT: successors:
1240-
; CHECK: {{ $}}
1241-
; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
1233+
; CHECK-NEXT: {{ $}}
1234+
; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
12421235
; CHECK-NEXT: BL @jt_2_tables_phi_edge_from_second, csr_aarch64_aapcs, implicit-def $lr, implicit $sp
12431236
; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
12441237
; CHECK-NEXT: {{ $}}
@@ -1463,8 +1456,8 @@ define i1 @i1_value_cmp_is_signed(i1) {
14631456
; CHECK-NEXT: {{ $}}
14641457
; CHECK-NEXT: bb.2.BadValue:
14651458
; CHECK-NEXT: successors:
1466-
; CHECK: {{ $}}
1467-
; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
1459+
; CHECK-NEXT: {{ $}}
1460+
; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
14681461
; CHECK-NEXT: BL @bar, csr_aarch64_aapcs, implicit-def $lr, implicit $sp
14691462
; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
14701463
; CHECK-NEXT: {{ $}}

0 commit comments

Comments
 (0)
Please sign in to comment.