1 ; RUN: llvm-as -f %s -o - | llc
4 ;; From: test/Programs/SingleSource/richards_benchmark.c
5 ;; Function: struct task *handlerfn(struct packet *pkt)
7 ;; Error: PreSelection puts the arguments of the Phi just before
8 ;; the Phi instead of in predecessor blocks. This later
9 ;; causes llc to produces an invalid register <NULL VALUE>
10 ;; for the phi arguments.
12 %struct..packet = type { %struct..packet*, int, int, int, [4 x sbyte] }
13 %struct..task = type { %struct..task*, int, int, %struct..packet*, int, %struct..task* (%struct..packet*)*, int, int }
14 %v1 = external global int
15 %v2 = external global int
17 implementation ; Functions:
19 %struct..task* %handlerfn(%struct..packet* %pkt.2) {
20 entry: ; No predecessors!
21 %tmp.1 = setne %struct..packet* %pkt.2, null
22 br bool %tmp.1, label %cond_false, label %cond_continue
24 cond_false: ; preds = %entry
25 br label %cond_continue
27 cond_continue: ; preds = %entry, %cond_false
28 %mem_tmp.0 = phi int* [ %v2, %cond_false ], [ %v1, %entry ]
29 %tmp.12 = cast int* %mem_tmp.0 to %struct..packet*
30 call void %append( %struct..packet* %pkt.2, %struct..packet* %tmp.12 )
31 ret %struct..task* null
34 declare void %append(%struct..packet*, %struct..packet*)