Skip to content

Commit 3a50f77

Browse files
author
Francis Visoiu Mistrih
committed
AsmPrinter: mark the beginning and the end of a function in verbose mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303690 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 59b664b commit 3a50f77

File tree

9 files changed

+282
-142
lines changed

9 files changed

+282
-142
lines changed

lib/CodeGen/AsmPrinter/AsmPrinter.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -628,12 +628,15 @@ void AsmPrinter::EmitDebugThreadLocal(const MCExpr *Value,
628628
/// EmitFunctionHeader - This method emits the header for the current
629629
/// function.
630630
void AsmPrinter::EmitFunctionHeader() {
631+
const Function *F = MF->getFunction();
632+
633+
if (isVerbose())
634+
OutStreamer->GetCommentOS() << "-- Begin function " << F->getName() << '\n';
635+
631636
// Print out constants referenced by the function
632637
EmitConstantPool();
633638

634639
// Print the 'header' of function.
635-
const Function *F = MF->getFunction();
636-
637640
OutStreamer->SwitchSection(getObjFileLowering().SectionForGlobal(F, TM));
638641
EmitVisibility(CurrentFnSym, F->getVisibility());
639642

@@ -1107,6 +1110,9 @@ void AsmPrinter::EmitFunctionBody() {
11071110
HI.Handler->endFunction(MF);
11081111
}
11091112

1113+
if (isVerbose())
1114+
OutStreamer->GetCommentOS() << "-- End function\n";
1115+
11101116
OutStreamer->AddBlankLine();
11111117
}
11121118

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; RUN: llc %s -mtriple=arm64-apple-darwin -o - | FileCheck %s
2+
3+
; CHECK-LABEL: ; -- Begin function foo
4+
; CHECK: foo:
5+
define hidden i32 @foo() {
6+
entry:
7+
ret i32 30
8+
}
9+
; CHECK: ; -- End function
10+
11+
; CHECK-LABEL: ; -- Begin function bar
12+
; CHECK: bar:
13+
define i32 @bar() {
14+
entry:
15+
ret i32 30
16+
}
17+
; CHECK: ; -- End function

test/CodeGen/ARM/fastisel-thumb-litpool.ll

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
; hence the CHECK-NOT.
66

77
define i32 @test_thumb_ldrlit() minsize {
8+
; CHECK-LABEL: test_thumb_ldrlit:
89
; CHECK: ldr r0, LCPI0_0
910
; CHECK-NOT: ldr
1011
ret i32 12345678

test/CodeGen/X86/fast-isel-select-cmp.ll

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
; different basic blocks.
55

66
define i32 @select_cmp_cmov_i32(i32 %a, i32 %b) {
7-
; CHECK-LABEL: select_cmp_cmov_i32
7+
; CHECK-LABEL: select_cmp_cmov_i32:
88
; CHECK-LABEL: continue
9-
; CHECK-NOT: cmp
9+
; CHECK-NOT: cmp{{[^_]}}
1010
%1 = icmp ult i32 %a, %b
1111
br i1 %1, label %continue, label %exit
1212

@@ -19,9 +19,9 @@ exit:
1919
}
2020

2121
define float @select_fcmp_oeq_f32(float %a, float %b, float %c, float %d) {
22-
; CHECK-LABEL: select_fcmp_oeq_f32
22+
; CHECK-LABEL: select_fcmp_oeq_f32:
2323
; CHECK-LABEL: continue
24-
; CHECK-NOT: cmp
24+
; CHECK-NOT: cmp{{[^_]}}
2525
%1 = fcmp oeq float %a, %b
2626
br i1 %1, label %continue, label %exit
2727

@@ -34,7 +34,7 @@ exit:
3434
}
3535

3636
define float @select_fcmp_one_f32(float %a, float %b, float %c, float %d) {
37-
; CHECK-LABEL: select_fcmp_one_f32
37+
; CHECK-LABEL: select_fcmp_one_f32:
3838
; CHECK-LABEL: continue
3939
; CHECK-NOT: ucomi
4040
%1 = fcmp one float %a, %b

test/CodeGen/X86/x87.ll

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
; RUN: llc < %s -march=x86 | FileCheck %s -check-prefix=X87
22
; RUN: llc < %s -march=x86-64 -mattr=-sse | FileCheck %s -check-prefix=X87
3-
; RUN: llc < %s -march=x86 -mattr=-x87 | FileCheck %s -check-prefix=NOX87 --implicit-check-not "{{ }}f{{.*}}"
4-
; RUN: llc < %s -march=x86-64 -mattr=-x87,-sse | FileCheck %s -check-prefix=NOX87 --implicit-check-not "{{ }}f{{.*}}"
5-
; RUN: llc < %s -march=x86 -mattr=-x87,+sse | FileCheck %s -check-prefix=NOX87 --implicit-check-not "{{ }}f{{.*}}"
6-
; RUN: llc < %s -march=x86-64 -mattr=-x87,-sse2 | FileCheck %s -check-prefix=NOX87 --implicit-check-not "{{ }}f{{.*}}"
3+
; RUN: llc < %s -march=x86 -mattr=-x87 | FileCheck %s -check-prefix=NOX87
4+
; RUN: llc < %s -march=x86-64 -mattr=-x87,-sse | FileCheck %s -check-prefix=NOX87
5+
; RUN: llc < %s -march=x86 -mattr=-x87,+sse | FileCheck %s -check-prefix=NOX87
6+
; RUN: llc < %s -march=x86-64 -mattr=-x87,-sse2 | FileCheck %s -check-prefix=NOX87
77

88
define void @test(i32 %i, i64 %l, float* %pf, double* %pd, fp128* %pld) nounwind readnone {
99
; X87-LABEL: test:
1010
; NOX87-LABEL: test:
11+
12+
; NOX87-NOT: {{ }}f{{.*}}
13+
1114
; X87: fild
1215
; NOX87: __floatunsisf
1316
%tmp = uitofp i32 %i to float

test/CodeGen/XCore/epilogue_prologue.ll

+12-12
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
; When using FP, for large or small frames, we may need one scratch register.
77

88
; FP + small frame: spill FP+SR = entsp 2
9-
; CHECKFP-LABEL: f1
9+
; CHECKFP-LABEL: f1:
1010
; CHECKFP: entsp 2
1111
; CHECKFP-NEXT: stw r10, sp[1]
1212
; CHECKFP-NEXT: ldaw r10, sp[0]
@@ -15,7 +15,7 @@
1515
; CHECKFP-NEXT: retsp 2
1616
;
1717
; !FP + small frame: no spills = no stack adjustment needed
18-
; CHECK-LABEL: f1
18+
; CHECK-LABEL: f1:
1919
; CHECK: stw lr, sp[0]
2020
; CHECK: ldw lr, sp[0]
2121
; CHECK-NEXT: retsp 0
@@ -27,7 +27,7 @@ entry:
2727

2828

2929
; FP + small frame: spill FP+SR+R0+LR = entsp 3 + extsp 1
30-
; CHECKFP-LABEL:f3
30+
; CHECKFP-LABEL: f3:
3131
; CHECKFP: entsp 3
3232
; CHECKFP-NEXT: stw r10, sp[1]
3333
; CHECKFP-NEXT: ldaw r10, sp[0]
@@ -43,7 +43,7 @@ entry:
4343
; CHECKFP-NEXT: retsp 3
4444
;
4545
; !FP + small frame: spill R0+LR = entsp 2
46-
; CHECK-LABEL: f3
46+
; CHECK-LABEL: f3:
4747
; CHECK: entsp 2
4848
; CHECK-NEXT: stw [[REG:r[4-9]+]], sp[1]
4949
; CHECK-NEXT: mov [[REG]], r0
@@ -60,7 +60,7 @@ entry:
6060

6161

6262
; FP + large frame: spill FP+SR = entsp 2 + 100000
63-
; CHECKFP-LABEL: f4
63+
; CHECKFP-LABEL: f4:
6464
; CHECKFP: entsp 65535
6565
; CHECKFP-NEXT: .Lcfi{{[0-9]+}}
6666
; CHECKFP-NEXT: .cfi_def_cfa_offset 262140
@@ -81,7 +81,7 @@ entry:
8181
; CHECKFP-NEXT: retsp 34467
8282
;
8383
; !FP + large frame: spill SR+SR = entsp 2 + 100000
84-
; CHECK-LABEL: f4
84+
; CHECK-LABEL: f4:
8585
; CHECK: entsp 65535
8686
; CHECK-NEXT: .Lcfi{{[0-9]+}}
8787
; CHECK-NEXT: .cfi_def_cfa_offset 262140
@@ -107,7 +107,7 @@ entry:
107107
; CHECKFP-NEXT: .LCPI[[CNST1:[0-9_]+]]:
108108
; CHECKFP-NEXT: .long 200001
109109
; CHECKFP-NEXT: .text
110-
; CHECKFP-LABEL: f6
110+
; CHECKFP-LABEL: f6:
111111
; CHECKFP: entsp 65535
112112
; CHECKFP-NEXT: .Lcfi{{[0-9]+}}
113113
; CHECKFP-NEXT: .cfi_def_cfa_offset 262140
@@ -160,7 +160,7 @@ entry:
160160
; CHECK-NEXT: .LCPI[[CNST1:[0-9_]+]]:
161161
; CHECK-NEXT: .long 200002
162162
; CHECK-NEXT: .text
163-
; CHECK-LABEL: f6
163+
; CHECK-LABEL: f6:
164164
; CHECK: entsp 65535
165165
; CHECK-NEXT: .Lcfi{{[0-9]+}}
166166
; CHECK-NEXT: .cfi_def_cfa_offset 262140
@@ -207,7 +207,7 @@ entry:
207207
}
208208

209209
; FP + large frame: spill FP+SR+LR = entsp 2 + 256 + extsp 1
210-
; CHECKFP-LABEL:f8
210+
; CHECKFP-LABEL: f8:
211211
; CHECKFP: entsp 258
212212
; CHECKFP-NEXT: stw r10, sp[1]
213213
; CHECKFP-NEXT: ldaw r10, sp[0]
@@ -221,7 +221,7 @@ entry:
221221
; CHECKFP-NEXT: retsp 258
222222
;
223223
; !FP + large frame: spill SR+SR+LR = entsp 3 + 256
224-
; CHECK-LABEL:f8
224+
; CHECK-LABEL: f8:
225225
; CHECK: entsp 257
226226
; CHECK-NEXT: ldaw r0, sp[254]
227227
; CHECK-NEXT: bl f5
@@ -235,7 +235,7 @@ entry:
235235
}
236236

237237
; FP + large frame: spill FP+SR+LR = entsp 2 + 32768 + extsp 1
238-
; CHECKFP-LABEL:f9
238+
; CHECKFP-LABEL: f9:
239239
; CHECKFP: entsp 32770
240240
; CHECKFP-NEXT: stw r10, sp[1]
241241
; CHECKFP-NEXT: ldaw r10, sp[0]
@@ -249,7 +249,7 @@ entry:
249249
; CHECKFP-NEXT: retsp 32770
250250
;
251251
; !FP + large frame: spill SR+SR+LR = entsp 3 + 32768
252-
; CHECK-LABEL:f9
252+
; CHECK-LABEL: f9:
253253
; CHECK: entsp 32771
254254
; CHECK-NEXT: ldaw r0, sp[32768]
255255
; CHECK-NEXT: bl f5

0 commit comments

Comments
 (0)