xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/2009-09-10-SpillComments.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-unknown-linux | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; This test shouldn't require spills.
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; CHECK: pushq
6*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: $rsp
7*9880d681SAndroid Build Coastguard Worker; CHECK: popq
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker	%struct..0anon = type { i32 }
10*9880d681SAndroid Build Coastguard Worker	%struct.rtvec_def = type { i32, [1 x %struct..0anon] }
11*9880d681SAndroid Build Coastguard Worker	%struct.rtx_def = type { i16, i8, i8, [1 x %struct..0anon] }
12*9880d681SAndroid Build Coastguard Worker@rtx_format = external global [116 x i8*]		; <[116 x i8*]*> [#uses=1]
13*9880d681SAndroid Build Coastguard Worker@rtx_length = external global [117 x i32]		; <[117 x i32]*> [#uses=1]
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Workerdeclare %struct.rtx_def* @fixup_memory_subreg(%struct.rtx_def*, %struct.rtx_def*, i32)
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Workerdefine %struct.rtx_def* @walk_fixup_memory_subreg(%struct.rtx_def* %x, %struct.rtx_def* %insn) {
18*9880d681SAndroid Build Coastguard Workerentry:
19*9880d681SAndroid Build Coastguard Worker	%tmp2 = icmp eq %struct.rtx_def* %x, null		; <i1> [#uses=1]
20*9880d681SAndroid Build Coastguard Worker	br i1 %tmp2, label %UnifiedReturnBlock, label %cond_next
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workercond_next:		; preds = %entry
23*9880d681SAndroid Build Coastguard Worker	%tmp6 = getelementptr %struct.rtx_def, %struct.rtx_def* %x, i32 0, i32 0		; <i16*> [#uses=1]
24*9880d681SAndroid Build Coastguard Worker	%tmp7 = load i16, i16* %tmp6		; <i16> [#uses=2]
25*9880d681SAndroid Build Coastguard Worker	%tmp78 = zext i16 %tmp7 to i32		; <i32> [#uses=2]
26*9880d681SAndroid Build Coastguard Worker	%tmp10 = icmp eq i16 %tmp7, 54		; <i1> [#uses=1]
27*9880d681SAndroid Build Coastguard Worker	br i1 %tmp10, label %cond_true13, label %cond_next32
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Workercond_true13:		; preds = %cond_next
30*9880d681SAndroid Build Coastguard Worker	%tmp15 = getelementptr %struct.rtx_def, %struct.rtx_def* %x, i32 0, i32 3		; <[1 x %struct..0anon]*> [#uses=1]
31*9880d681SAndroid Build Coastguard Worker	%tmp1718 = bitcast [1 x %struct..0anon]* %tmp15 to %struct.rtx_def**		; <%struct.rtx_def**> [#uses=1]
32*9880d681SAndroid Build Coastguard Worker	%tmp19 = load %struct.rtx_def*, %struct.rtx_def** %tmp1718		; <%struct.rtx_def*> [#uses=1]
33*9880d681SAndroid Build Coastguard Worker	%tmp20 = getelementptr %struct.rtx_def, %struct.rtx_def* %tmp19, i32 0, i32 0		; <i16*> [#uses=1]
34*9880d681SAndroid Build Coastguard Worker	%tmp21 = load i16, i16* %tmp20		; <i16> [#uses=1]
35*9880d681SAndroid Build Coastguard Worker	%tmp22 = icmp eq i16 %tmp21, 57		; <i1> [#uses=1]
36*9880d681SAndroid Build Coastguard Worker	br i1 %tmp22, label %cond_true25, label %cond_next32
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Workercond_true25:		; preds = %cond_true13
39*9880d681SAndroid Build Coastguard Worker	%tmp29 = tail call %struct.rtx_def* @fixup_memory_subreg( %struct.rtx_def* %x, %struct.rtx_def* %insn, i32 1 ) nounwind		; <%struct.rtx_def*> [#uses=1]
40*9880d681SAndroid Build Coastguard Worker	ret %struct.rtx_def* %tmp29
41*9880d681SAndroid Build Coastguard Worker
42*9880d681SAndroid Build Coastguard Workercond_next32:		; preds = %cond_true13, %cond_next
43*9880d681SAndroid Build Coastguard Worker	%tmp34 = getelementptr [116 x i8*], [116 x i8*]* @rtx_format, i32 0, i32 %tmp78		; <i8**> [#uses=1]
44*9880d681SAndroid Build Coastguard Worker	%tmp35 = load i8*, i8** %tmp34, align 4		; <i8*> [#uses=1]
45*9880d681SAndroid Build Coastguard Worker	%tmp37 = getelementptr [117 x i32], [117 x i32]* @rtx_length, i32 0, i32 %tmp78		; <i32*> [#uses=1]
46*9880d681SAndroid Build Coastguard Worker	%tmp38 = load i32, i32* %tmp37, align 4		; <i32> [#uses=1]
47*9880d681SAndroid Build Coastguard Worker	%i.011 = add i32 %tmp38, -1		; <i32> [#uses=2]
48*9880d681SAndroid Build Coastguard Worker	%tmp12513 = icmp sgt i32 %i.011, -1		; <i1> [#uses=1]
49*9880d681SAndroid Build Coastguard Worker	br i1 %tmp12513, label %bb, label %UnifiedReturnBlock
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard Workerbb:		; preds = %bb123, %cond_next32
52*9880d681SAndroid Build Coastguard Worker	%indvar = phi i32 [ %indvar.next26, %bb123 ], [ 0, %cond_next32 ]		; <i32> [#uses=2]
53*9880d681SAndroid Build Coastguard Worker	%i.01.0 = sub i32 %i.011, %indvar		; <i32> [#uses=5]
54*9880d681SAndroid Build Coastguard Worker	%tmp42 = getelementptr i8, i8* %tmp35, i32 %i.01.0		; <i8*> [#uses=2]
55*9880d681SAndroid Build Coastguard Worker	%tmp43 = load i8, i8* %tmp42		; <i8> [#uses=1]
56*9880d681SAndroid Build Coastguard Worker	switch i8 %tmp43, label %bb123 [
57*9880d681SAndroid Build Coastguard Worker		 i8 101, label %cond_true47
58*9880d681SAndroid Build Coastguard Worker		 i8 69, label %bb105.preheader
59*9880d681SAndroid Build Coastguard Worker	]
60*9880d681SAndroid Build Coastguard Worker
61*9880d681SAndroid Build Coastguard Workercond_true47:		; preds = %bb
62*9880d681SAndroid Build Coastguard Worker	%tmp52 = getelementptr %struct.rtx_def, %struct.rtx_def* %x, i32 0, i32 3, i32 %i.01.0		; <%struct..0anon*> [#uses=1]
63*9880d681SAndroid Build Coastguard Worker	%tmp5354 = bitcast %struct..0anon* %tmp52 to %struct.rtx_def**		; <%struct.rtx_def**> [#uses=1]
64*9880d681SAndroid Build Coastguard Worker	%tmp55 = load %struct.rtx_def*, %struct.rtx_def** %tmp5354		; <%struct.rtx_def*> [#uses=1]
65*9880d681SAndroid Build Coastguard Worker	%tmp58 = tail call  %struct.rtx_def* @walk_fixup_memory_subreg( %struct.rtx_def* %tmp55, %struct.rtx_def* %insn ) nounwind		; <%struct.rtx_def*> [#uses=1]
66*9880d681SAndroid Build Coastguard Worker	%tmp62 = getelementptr %struct.rtx_def, %struct.rtx_def* %x, i32 0, i32 3, i32 %i.01.0, i32 0		; <i32*> [#uses=1]
67*9880d681SAndroid Build Coastguard Worker	%tmp58.c = ptrtoint %struct.rtx_def* %tmp58 to i32		; <i32> [#uses=1]
68*9880d681SAndroid Build Coastguard Worker	store i32 %tmp58.c, i32* %tmp62
69*9880d681SAndroid Build Coastguard Worker	%tmp6816 = load i8, i8* %tmp42		; <i8> [#uses=1]
70*9880d681SAndroid Build Coastguard Worker	%tmp6917 = icmp eq i8 %tmp6816, 69		; <i1> [#uses=1]
71*9880d681SAndroid Build Coastguard Worker	br i1 %tmp6917, label %bb105.preheader, label %bb123
72*9880d681SAndroid Build Coastguard Worker
73*9880d681SAndroid Build Coastguard Workerbb105.preheader:		; preds = %cond_true47, %bb
74*9880d681SAndroid Build Coastguard Worker	%tmp11020 = getelementptr %struct.rtx_def, %struct.rtx_def* %x, i32 0, i32 3, i32 %i.01.0		; <%struct..0anon*> [#uses=1]
75*9880d681SAndroid Build Coastguard Worker	%tmp11111221 = bitcast %struct..0anon* %tmp11020 to %struct.rtvec_def**		; <%struct.rtvec_def**> [#uses=3]
76*9880d681SAndroid Build Coastguard Worker	%tmp11322 = load %struct.rtvec_def*, %struct.rtvec_def** %tmp11111221		; <%struct.rtvec_def*> [#uses=1]
77*9880d681SAndroid Build Coastguard Worker	%tmp11423 = getelementptr %struct.rtvec_def, %struct.rtvec_def* %tmp11322, i32 0, i32 0		; <i32*> [#uses=1]
78*9880d681SAndroid Build Coastguard Worker	%tmp11524 = load i32, i32* %tmp11423		; <i32> [#uses=1]
79*9880d681SAndroid Build Coastguard Worker	%tmp11625 = icmp eq i32 %tmp11524, 0		; <i1> [#uses=1]
80*9880d681SAndroid Build Coastguard Worker	br i1 %tmp11625, label %bb123, label %bb73
81*9880d681SAndroid Build Coastguard Worker
82*9880d681SAndroid Build Coastguard Workerbb73:		; preds = %bb73, %bb105.preheader
83*9880d681SAndroid Build Coastguard Worker	%j.019 = phi i32 [ %tmp104, %bb73 ], [ 0, %bb105.preheader ]		; <i32> [#uses=3]
84*9880d681SAndroid Build Coastguard Worker	%tmp81 = load %struct.rtvec_def*, %struct.rtvec_def** %tmp11111221		; <%struct.rtvec_def*> [#uses=2]
85*9880d681SAndroid Build Coastguard Worker	%tmp92 = getelementptr %struct.rtvec_def, %struct.rtvec_def* %tmp81, i32 0, i32 1, i32 %j.019		; <%struct..0anon*> [#uses=1]
86*9880d681SAndroid Build Coastguard Worker	%tmp9394 = bitcast %struct..0anon* %tmp92 to %struct.rtx_def**		; <%struct.rtx_def**> [#uses=1]
87*9880d681SAndroid Build Coastguard Worker	%tmp95 = load %struct.rtx_def*, %struct.rtx_def** %tmp9394		; <%struct.rtx_def*> [#uses=1]
88*9880d681SAndroid Build Coastguard Worker	%tmp98 = tail call  %struct.rtx_def* @walk_fixup_memory_subreg( %struct.rtx_def* %tmp95, %struct.rtx_def* %insn ) nounwind		; <%struct.rtx_def*> [#uses=1]
89*9880d681SAndroid Build Coastguard Worker	%tmp101 = getelementptr %struct.rtvec_def, %struct.rtvec_def* %tmp81, i32 0, i32 1, i32 %j.019, i32 0		; <i32*> [#uses=1]
90*9880d681SAndroid Build Coastguard Worker	%tmp98.c = ptrtoint %struct.rtx_def* %tmp98 to i32		; <i32> [#uses=1]
91*9880d681SAndroid Build Coastguard Worker	store i32 %tmp98.c, i32* %tmp101
92*9880d681SAndroid Build Coastguard Worker	%tmp104 = add i32 %j.019, 1		; <i32> [#uses=2]
93*9880d681SAndroid Build Coastguard Worker	%tmp113 = load %struct.rtvec_def*, %struct.rtvec_def** %tmp11111221		; <%struct.rtvec_def*> [#uses=1]
94*9880d681SAndroid Build Coastguard Worker	%tmp114 = getelementptr %struct.rtvec_def, %struct.rtvec_def* %tmp113, i32 0, i32 0		; <i32*> [#uses=1]
95*9880d681SAndroid Build Coastguard Worker	%tmp115 = load i32, i32* %tmp114		; <i32> [#uses=1]
96*9880d681SAndroid Build Coastguard Worker	%tmp116 = icmp ult i32 %tmp104, %tmp115		; <i1> [#uses=1]
97*9880d681SAndroid Build Coastguard Worker	br i1 %tmp116, label %bb73, label %bb123
98*9880d681SAndroid Build Coastguard Worker
99*9880d681SAndroid Build Coastguard Workerbb123:		; preds = %bb73, %bb105.preheader, %cond_true47, %bb
100*9880d681SAndroid Build Coastguard Worker	%i.0 = add i32 %i.01.0, -1		; <i32> [#uses=1]
101*9880d681SAndroid Build Coastguard Worker	%tmp125 = icmp sgt i32 %i.0, -1		; <i1> [#uses=1]
102*9880d681SAndroid Build Coastguard Worker	%indvar.next26 = add i32 %indvar, 1		; <i32> [#uses=1]
103*9880d681SAndroid Build Coastguard Worker	br i1 %tmp125, label %bb, label %UnifiedReturnBlock
104*9880d681SAndroid Build Coastguard Worker
105*9880d681SAndroid Build Coastguard WorkerUnifiedReturnBlock:		; preds = %bb123, %cond_next32, %entry
106*9880d681SAndroid Build Coastguard Worker	%UnifiedRetVal = phi %struct.rtx_def* [ null, %entry ], [ %x, %cond_next32 ], [ %x, %bb123 ]		; <%struct.rtx_def*> [#uses=1]
107*9880d681SAndroid Build Coastguard Worker	ret %struct.rtx_def* %UnifiedRetVal
108*9880d681SAndroid Build Coastguard Worker}
109