| Reid Spencer | ed3471a | 2006-12-02 20:38:10 +0000 | [diff] [blame^] | 1 | ; RUN: llvm-upgrade %s | llvm-as | llc | 
| Tanya Lattner | 16b222c | 2004-11-06 23:08:26 +0000 | [diff] [blame] | 2 |  | 
| Vikram S. Adve | a48e258 | 2003-05-31 04:45:56 +0000 | [diff] [blame] | 3 | ;; Date:     May 28, 2003. | 
|  | 4 | ;; From:     test/Programs/SingleSource/richards_benchmark.c | 
|  | 5 | ;; Function: struct task *handlerfn(struct packet *pkt) | 
|  | 6 | ;; | 
|  | 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. | 
| Vikram S. Adve | a48e258 | 2003-05-31 04:45:56 +0000 | [diff] [blame] | 11 |  | 
| Vikram S. Adve | a48e258 | 2003-05-31 04:45:56 +0000 | [diff] [blame] | 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 | 
|  | 16 |  | 
|  | 17 | implementation   ; Functions: | 
|  | 18 |  | 
|  | 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 | 
|  | 23 |  | 
|  | 24 | cond_false:		; preds = %entry | 
|  | 25 | br label %cond_continue | 
|  | 26 |  | 
|  | 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 | 
|  | 32 | } | 
|  | 33 |  | 
|  | 34 | declare void %append(%struct..packet*, %struct..packet*) |