blob: 86006384821dfde18f800958bbf249cdb12ad30f [file] [log] [blame]
Reid Spencer0db64ca2006-12-19 02:07:11 +00001; RUN: llvm-upgrade < %s | llvm-as | llc
Tanya Lattner2393a242004-11-06 23:08:26 +00002
Vikram S. Adve16242152003-05-31 04:45:56 +00003;; Date: May 28, 2003.
4;; From: test/Programs/External/SPEC/CINT2000/175.vpr.llvm.bc
5;; Function: int %main(int %argc.1, sbyte** %argv.1)
6;;
7;; Error: A function call with about 56 arguments causes an assertion failure
8;; in llc because the register allocator cannot find a register
9;; not used explicitly by the call instruction.
10;;
11;; Cause: Regalloc was not keeping track of free registers correctly.
12;; It was counting the registers allocated to all outgoing arguments,
13;; even though most of those are copied to the stack (so those
14;; registers are not actually used by the call instruction).
15;;
16;; Fixed: By rewriting selection and allocation so that selection explicitly
17;; inserts all copy operations required for passing arguments and
18;; for the return value of a call, copying to/from registers
19;; and/or to stack locations as needed.
20;;
21
Vikram S. Adve16242152003-05-31 04:45:56 +000022 %struct..s_annealing_sched = type { uint, float, float, float, float }
23 %struct..s_chan = type { uint, float, float, float, float }
24 %struct..s_det_routing_arch = type { uint, float, float, float, uint, int, short, short, short, float, float }
25 %struct..s_placer_opts = type { int, float, int, uint, sbyte*, uint, int }
26 %struct..s_router_opts = type { float, float, float, float, float, int, int, uint, int }
27 %struct..s_segment_inf = type { float, int, short, short, float, float, uint, float, float }
28 %struct..s_switch_inf = type { uint, float, float, float, float }
29
30implementation
31
32int %main(int %argc.1, sbyte** %argv.1) {
33entry:
34 %net_file = alloca [300 x sbyte]
35 %place_file = alloca [300 x sbyte]
36 %arch_file = alloca [300 x sbyte]
37 %route_file = alloca [300 x sbyte]
38 %full_stats = alloca uint
39 %operation = alloca int
40 %verify_binary_search = alloca uint
41 %show_graphics = alloca uint
42 %annealing_sched = alloca %struct..s_annealing_sched
43 %placer_opts = alloca %struct..s_placer_opts
44 %router_opts = alloca %struct..s_router_opts
45 %det_routing_arch = alloca %struct..s_det_routing_arch
46 %segment_inf = alloca %struct..s_segment_inf*
47 %timing_inf = alloca { uint, float, float, float, float, float, float, float, float, float, float }
Reid Spencere5d4efa2006-11-23 15:14:52 +000048 %tmp.101 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 4
Vikram S. Adve16242152003-05-31 04:45:56 +000049 %tmp.105 = getelementptr [300 x sbyte]* %net_file, long 0, long 0
50 %tmp.106 = getelementptr [300 x sbyte]* %arch_file, long 0, long 0
51 %tmp.107 = getelementptr [300 x sbyte]* %place_file, long 0, long 0
52 %tmp.108 = getelementptr [300 x sbyte]* %route_file, long 0, long 0
Reid Spencere5d4efa2006-11-23 15:14:52 +000053 %tmp.109 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 0
54 %tmp.112 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 0
55 %tmp.114 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 6
56 %tmp.118 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 7
Vikram S. Adve16242152003-05-31 04:45:56 +000057 %tmp.135 = load int* %operation
58 %tmp.137 = load int* %tmp.112
Reid Spencere5d4efa2006-11-23 15:14:52 +000059 %tmp.138 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 1
Vikram S. Adve16242152003-05-31 04:45:56 +000060 %tmp.139 = load float* %tmp.138
Reid Spencere5d4efa2006-11-23 15:14:52 +000061 %tmp.140 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 2
Vikram S. Adve16242152003-05-31 04:45:56 +000062 %tmp.141 = load int* %tmp.140
Reid Spencere5d4efa2006-11-23 15:14:52 +000063 %tmp.142 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 3
Vikram S. Adve16242152003-05-31 04:45:56 +000064 %tmp.143 = load uint* %tmp.142
65 %tmp.145 = load sbyte** %tmp.101
Reid Spencere5d4efa2006-11-23 15:14:52 +000066 %tmp.146 = getelementptr %struct..s_placer_opts* %placer_opts, long 0, uint 5
Vikram S. Adve16242152003-05-31 04:45:56 +000067 %tmp.147 = load uint* %tmp.146
68 %tmp.149 = load int* %tmp.114
69 %tmp.154 = load uint* %full_stats
70 %tmp.155 = load uint* %verify_binary_search
Reid Spencere5d4efa2006-11-23 15:14:52 +000071 %tmp.156 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 0
Vikram S. Adve16242152003-05-31 04:45:56 +000072 %tmp.157 = load uint* %tmp.156
Reid Spencere5d4efa2006-11-23 15:14:52 +000073 %tmp.158 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 1
Vikram S. Adve16242152003-05-31 04:45:56 +000074 %tmp.159 = load float* %tmp.158
Reid Spencere5d4efa2006-11-23 15:14:52 +000075 %tmp.160 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 2
Vikram S. Adve16242152003-05-31 04:45:56 +000076 %tmp.161 = load float* %tmp.160
Reid Spencere5d4efa2006-11-23 15:14:52 +000077 %tmp.162 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 3
Vikram S. Adve16242152003-05-31 04:45:56 +000078 %tmp.163 = load float* %tmp.162
Reid Spencere5d4efa2006-11-23 15:14:52 +000079 %tmp.164 = getelementptr %struct..s_annealing_sched* %annealing_sched, long 0, uint 4
Vikram S. Adve16242152003-05-31 04:45:56 +000080 %tmp.165 = load float* %tmp.164
Reid Spencere5d4efa2006-11-23 15:14:52 +000081 %tmp.166 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 0
Vikram S. Adve16242152003-05-31 04:45:56 +000082 %tmp.167 = load float* %tmp.166
Reid Spencere5d4efa2006-11-23 15:14:52 +000083 %tmp.168 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 1
Vikram S. Adve16242152003-05-31 04:45:56 +000084 %tmp.169 = load float* %tmp.168
Reid Spencere5d4efa2006-11-23 15:14:52 +000085 %tmp.170 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 2
Vikram S. Adve16242152003-05-31 04:45:56 +000086 %tmp.171 = load float* %tmp.170
Reid Spencere5d4efa2006-11-23 15:14:52 +000087 %tmp.172 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 3
Vikram S. Adve16242152003-05-31 04:45:56 +000088 %tmp.173 = load float* %tmp.172
Reid Spencere5d4efa2006-11-23 15:14:52 +000089 %tmp.174 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 4
Vikram S. Adve16242152003-05-31 04:45:56 +000090 %tmp.175 = load float* %tmp.174
Reid Spencere5d4efa2006-11-23 15:14:52 +000091 %tmp.176 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 5
Vikram S. Adve16242152003-05-31 04:45:56 +000092 %tmp.177 = load int* %tmp.176
Reid Spencere5d4efa2006-11-23 15:14:52 +000093 %tmp.178 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 6
Vikram S. Adve16242152003-05-31 04:45:56 +000094 %tmp.179 = load int* %tmp.178
95 %tmp.181 = load uint* %tmp.118
Reid Spencere5d4efa2006-11-23 15:14:52 +000096 %tmp.182 = getelementptr %struct..s_router_opts* %router_opts, long 0, uint 8
Vikram S. Adve16242152003-05-31 04:45:56 +000097 %tmp.183 = load int* %tmp.182
Reid Spencere5d4efa2006-11-23 15:14:52 +000098 %tmp.184 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 0
Vikram S. Adve16242152003-05-31 04:45:56 +000099 %tmp.185 = load uint* %tmp.184
Reid Spencere5d4efa2006-11-23 15:14:52 +0000100 %tmp.186 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 1
Vikram S. Adve16242152003-05-31 04:45:56 +0000101 %tmp.187 = load float* %tmp.186
Reid Spencere5d4efa2006-11-23 15:14:52 +0000102 %tmp.188 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 2
Vikram S. Adve16242152003-05-31 04:45:56 +0000103 %tmp.189 = load float* %tmp.188
Reid Spencere5d4efa2006-11-23 15:14:52 +0000104 %tmp.190 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 3
Vikram S. Adve16242152003-05-31 04:45:56 +0000105 %tmp.191 = load float* %tmp.190
Reid Spencere5d4efa2006-11-23 15:14:52 +0000106 %tmp.192 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 4
Vikram S. Adve16242152003-05-31 04:45:56 +0000107 %tmp.193 = load uint* %tmp.192
Reid Spencere5d4efa2006-11-23 15:14:52 +0000108 %tmp.194 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 5
Vikram S. Adve16242152003-05-31 04:45:56 +0000109 %tmp.195 = load int* %tmp.194
Reid Spencere5d4efa2006-11-23 15:14:52 +0000110 %tmp.196 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 6
Vikram S. Adve16242152003-05-31 04:45:56 +0000111 %tmp.197 = load short* %tmp.196
Reid Spencere5d4efa2006-11-23 15:14:52 +0000112 %tmp.198 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 7
Vikram S. Adve16242152003-05-31 04:45:56 +0000113 %tmp.199 = load short* %tmp.198
Reid Spencere5d4efa2006-11-23 15:14:52 +0000114 %tmp.200 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 8
Vikram S. Adve16242152003-05-31 04:45:56 +0000115 %tmp.201 = load short* %tmp.200
Reid Spencere5d4efa2006-11-23 15:14:52 +0000116 %tmp.202 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 9
Vikram S. Adve16242152003-05-31 04:45:56 +0000117 %tmp.203 = load float* %tmp.202
Reid Spencere5d4efa2006-11-23 15:14:52 +0000118 %tmp.204 = getelementptr %struct..s_det_routing_arch* %det_routing_arch, long 0, uint 10
Vikram S. Adve16242152003-05-31 04:45:56 +0000119 %tmp.205 = load float* %tmp.204
120 %tmp.206 = load %struct..s_segment_inf** %segment_inf
121 %tmp.208 = load uint* %tmp.109
Reid Spencere5d4efa2006-11-23 15:14:52 +0000122 %tmp.209 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 1
Vikram S. Adve16242152003-05-31 04:45:56 +0000123 %tmp.210 = load float* %tmp.209
Reid Spencere5d4efa2006-11-23 15:14:52 +0000124 %tmp.211 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 2
Vikram S. Adve16242152003-05-31 04:45:56 +0000125 %tmp.212 = load float* %tmp.211
Reid Spencere5d4efa2006-11-23 15:14:52 +0000126 %tmp.213 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 3
Vikram S. Adve16242152003-05-31 04:45:56 +0000127 %tmp.214 = load float* %tmp.213
Reid Spencere5d4efa2006-11-23 15:14:52 +0000128 %tmp.215 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 4
Vikram S. Adve16242152003-05-31 04:45:56 +0000129 %tmp.216 = load float* %tmp.215
Reid Spencere5d4efa2006-11-23 15:14:52 +0000130 %tmp.217 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 5
Vikram S. Adve16242152003-05-31 04:45:56 +0000131 %tmp.218 = load float* %tmp.217
Reid Spencere5d4efa2006-11-23 15:14:52 +0000132 %tmp.219 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 6
Vikram S. Adve16242152003-05-31 04:45:56 +0000133 %tmp.220 = load float* %tmp.219
Reid Spencere5d4efa2006-11-23 15:14:52 +0000134 %tmp.221 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 7
Vikram S. Adve16242152003-05-31 04:45:56 +0000135 %tmp.222 = load float* %tmp.221
Reid Spencere5d4efa2006-11-23 15:14:52 +0000136 %tmp.223 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 8
Vikram S. Adve16242152003-05-31 04:45:56 +0000137 %tmp.224 = load float* %tmp.223
Reid Spencere5d4efa2006-11-23 15:14:52 +0000138 %tmp.225 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 9
Vikram S. Adve16242152003-05-31 04:45:56 +0000139 %tmp.226 = load float* %tmp.225
Reid Spencere5d4efa2006-11-23 15:14:52 +0000140 %tmp.227 = getelementptr { uint, float, float, float, float, float, float, float, float, float, float }* %timing_inf, long 0, uint 10
Vikram S. Adve16242152003-05-31 04:45:56 +0000141 %tmp.228 = load float* %tmp.227
142 call void %place_and_route( int %tmp.135, int %tmp.137, float %tmp.139, int %tmp.141, uint %tmp.143, sbyte* %tmp.145, uint %tmp.147, int %tmp.149, sbyte* %tmp.107, sbyte* %tmp.105, sbyte* %tmp.106, sbyte* %tmp.108, uint %tmp.154, uint %tmp.155, uint %tmp.157, float %tmp.159, float %tmp.161, float %tmp.163, float %tmp.165, float %tmp.167, float %tmp.169, float %tmp.171, float %tmp.173, float %tmp.175, int %tmp.177, int %tmp.179, uint %tmp.181, int %tmp.183, uint %tmp.185, float %tmp.187, float %tmp.189, float %tmp.191, uint %tmp.193, int %tmp.195, short %tmp.197, short %tmp.199, short %tmp.201, float %tmp.203, float %tmp.205, %struct..s_segment_inf* %tmp.206, uint %tmp.208, float %tmp.210, float %tmp.212, float %tmp.214, float %tmp.216, float %tmp.218, float %tmp.220, float %tmp.222, float %tmp.224, float %tmp.226, float %tmp.228 )
143 %tmp.231 = load uint* %show_graphics
144 %tmp.232 = setne uint %tmp.231, 0
145 br bool %tmp.232, label %then.2, label %endif.2
146
147then.2:
148 br label %endif.2
149
150endif.2:
151 ret int 0
152}
153
154declare int %printf(sbyte*, ...)
155
156declare void %place_and_route(int, int, float, int, uint, sbyte*, uint, int, sbyte*, sbyte*, sbyte*, sbyte*, uint, uint, uint, float, float, float, float, float, float, float, float, float, int, int, uint, int, uint, float, float, float, uint, int, short, short, short, float, float, %struct..s_segment_inf*, uint, float, float, float, float, float, float, float, float, float, float)