Skip to content

Commit 54a68f7

Browse files
committed
[X86] Regenerate callee-saved test checks to make D65354 diff easier
llvm-svn: 367425
1 parent 83d8d62 commit 54a68f7

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

llvm/test/CodeGen/X86/DynamicCalleeSavedRegisters.ll

+33-23
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,65 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
12
; RUN: llc < %s -mtriple=i386-linux-gnu | FileCheck %s
23

34
declare x86_regcallcc i32 @callee(i32 %a0, i32 %b0, i32 %c0, i32 %d0, i32 %e0);
45

56
; In RegCall calling convention, ESI and EDI are callee saved registers.
67
; One might think that the caller could assume that ESI value is the same before
78
; and after calling the callee.
8-
; However, RegCall also says that a register that was used for
9+
; However, RegCall also says that a register that was used for
910
; passing/returning argumnets, can be assumed to be modified by the callee.
1011
; In other words, it is no longer a callee saved register.
1112
; In this case we want to see that EDX/ECX values are saved and EDI/ESI are assumed
1213
; to be modified by the callee.
1314
; This is a hipe CC function that doesn't save any register for the caller.
1415
; So we can be sure that there is no other reason to save EDX/ECX.
15-
; The caller arguments are expected to be passed (in the following order)
16+
; The caller arguments are expected to be passed (in the following order)
1617
; in registers: ESI, EBP, EAX, EDX and ECX.
1718
define cc 11 i32 @caller(i32 %a0, i32 %b0, i32 %c0, i32 %d0, i32 %e0) nounwind {
19+
; CHECK-LABEL: caller:
20+
; CHECK: # %bb.0:
21+
; CHECK-NEXT: subl $12, %esp
22+
; CHECK-NEXT: movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
23+
; CHECK-NEXT: movl %edx, %ebx
24+
; CHECK-NEXT: movl %eax, %edx
25+
; CHECK-NEXT: movl %esi, %eax
26+
; CHECK-NEXT: movl %ebp, %ecx
27+
; CHECK-NEXT: movl %ebx, %edi
28+
; CHECK-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Reload
29+
; CHECK-NEXT: movl %ebp, %esi
30+
; CHECK-NEXT: calll callee
31+
; CHECK-NEXT: leal (%eax,%ebx), %esi
32+
; CHECK-NEXT: addl %ebp, %esi
33+
; CHECK-NEXT: addl $12, %esp
34+
; CHECK-NEXT: retl
1835
%b1 = call x86_regcallcc i32 @callee(i32 %a0, i32 %b0, i32 %c0, i32 %d0, i32 %e0)
1936
%b2 = add i32 %b1, %d0
2037
%b3 = add i32 %b2, %e0
2138
ret i32 %b3
2239
}
23-
; CHECK-LABEL: caller
24-
; CHECK: subl $12, %esp
25-
; CHECK-NEXT: movl %ecx, 8(%esp)
26-
; CHECK-NEXT: movl %edx, %ebx
27-
; CHECK-NEXT: movl %eax, %edx
28-
; CHECK-NEXT: movl %esi, %eax
29-
; CHECK-NEXT: movl %ebp, %ecx
30-
; CHECK-NEXT: movl %ebx, %edi
31-
; CHECK-NEXT: movl 8(%esp), %ebp
32-
; CHECK-NEXT: movl %ebp, %esi
33-
; CHECK-NEXT: calll callee
34-
; CHECK-NEXT: leal (%eax,%ebx), %esi
35-
; CHECK-NEXT: addl %ebp, %esi
36-
; CHECK-NEXT: addl $12, %esp
37-
; CHECK-NEXT: retl
38-
3940
!hipe.literals = !{ !0, !1, !2 }
4041
!0 = !{ !"P_NSP_LIMIT", i32 120 }
4142
!1 = !{ !"X86_LEAF_WORDS", i32 24 }
4243
!2 = !{ !"AMD64_LEAF_WORDS", i32 18 }
4344

4445
; Make sure that the callee doesn't save parameters that were passed as arguments.
45-
; The caller arguments are expected to be passed (in the following order)
46+
; The caller arguments are expected to be passed (in the following order)
4647
; in registers: EAX, ECX, EDX, EDI and ESI.
4748
; The result will return in EAX, ECX and EDX.
4849
define x86_regcallcc {i32, i32, i32} @test_callee(i32 %a0, i32 %b0, i32 %c0, i32 %d0, i32 %e0) nounwind {
50+
; CHECK-LABEL: test_callee:
51+
; CHECK: # %bb.0:
52+
; CHECK-NEXT: leal (,%esi,8), %ecx
53+
; CHECK-NEXT: subl %esi, %ecx
54+
; CHECK-NEXT: movl $5, %eax
55+
; CHECK-NEXT: xorl %edx, %edx
56+
; CHECK-NEXT: divl %esi
57+
; CHECK-NEXT: movl %eax, %esi
58+
; CHECK-NEXT: leal (,%edi,8), %edx
59+
; CHECK-NEXT: subl %edi, %edx
60+
; CHECK-NEXT: movl %ecx, %eax
61+
; CHECK-NEXT: movl %esi, %ecx
62+
; CHECK-NEXT: retl
4963
%b1 = mul i32 7, %e0
5064
%b2 = udiv i32 5, %e0
5165
%b3 = mul i32 7, %d0
@@ -54,7 +68,3 @@ define x86_regcallcc {i32, i32, i32} @test_callee(i32 %a0, i32 %b0, i32 %c0, i32
5468
%b6 = insertvalue {i32, i32, i32} %b5, i32 %b3, 2
5569
ret {i32, i32, i32} %b6
5670
}
57-
; CHECK-LABEL: test_callee
58-
; CHECK-NOT: pushl %esi
59-
; CHECK-NOT: pushl %edi
60-
; CHECK: retl

0 commit comments

Comments
 (0)