Optimized FCMP_OEQ and FCMP_UNE for x86.
[oota-llvm.git] / test / CodeGen / X86 / 2007-11-14-Coalescer-Bug.ll
1 ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep movl | count 1
2
3         %struct.double_int = type { i64, i64 }
4         %struct.tree_common = type <{ i8, [3 x i8] }>
5         %struct.tree_int_cst = type { %struct.tree_common, %struct.double_int }
6         %struct.tree_node = type { %struct.tree_int_cst }
7 @tree_code_type = external constant [0 x i32]           ; <[0 x i32]*> [#uses=1]
8
9 define i32 @simple_cst_equal(%struct.tree_node* %t1, %struct.tree_node* %t2) {
10 entry:
11         %tmp2526 = bitcast %struct.tree_node* %t1 to i32*               ; <i32*> [#uses=1]
12         br i1 false, label %UnifiedReturnBlock, label %bb21
13
14 bb21:           ; preds = %entry
15         %tmp27 = load i32* %tmp2526, align 4            ; <i32> [#uses=1]
16         %tmp29 = and i32 %tmp27, 255            ; <i32> [#uses=3]
17         %tmp2930 = trunc i32 %tmp29 to i8               ; <i8> [#uses=1]
18         %tmp37 = load i32* null, align 4                ; <i32> [#uses=1]
19         %tmp39 = and i32 %tmp37, 255            ; <i32> [#uses=2]
20         %tmp3940 = trunc i32 %tmp39 to i8               ; <i8> [#uses=1]
21         %tmp43 = add i32 %tmp29, -3             ; <i32> [#uses=1]
22         %tmp44 = icmp ult i32 %tmp43, 3         ; <i1> [#uses=1]
23         br i1 %tmp44, label %bb47.split, label %bb76
24
25 bb47.split:             ; preds = %bb21
26         ret i32 0
27
28 bb76:           ; preds = %bb21
29         br i1 false, label %bb82, label %bb146.split
30
31 bb82:           ; preds = %bb76
32         %tmp94 = getelementptr [0 x i32]* @tree_code_type, i32 0, i32 %tmp39            ; <i32*> [#uses=1]
33         %tmp95 = load i32* %tmp94, align 4              ; <i32> [#uses=1]
34         %tmp9596 = trunc i32 %tmp95 to i8               ; <i8> [#uses=1]
35         %tmp98 = add i8 %tmp9596, -4            ; <i8> [#uses=1]
36         %tmp99 = icmp ugt i8 %tmp98, 5          ; <i1> [#uses=1]
37         br i1 %tmp99, label %bb102, label %bb106
38
39 bb102:          ; preds = %bb82
40         ret i32 0
41
42 bb106:          ; preds = %bb82
43         ret i32 0
44
45 bb146.split:            ; preds = %bb76
46         %tmp149 = icmp eq i8 %tmp2930, %tmp3940         ; <i1> [#uses=1]
47         br i1 %tmp149, label %bb153, label %UnifiedReturnBlock
48
49 bb153:          ; preds = %bb146.split
50         switch i32 %tmp29, label %UnifiedReturnBlock [
51                  i32 0, label %bb155
52                  i32 1, label %bb187
53         ]
54
55 bb155:          ; preds = %bb153
56         ret i32 0
57
58 bb187:          ; preds = %bb153
59         %tmp198 = icmp eq %struct.tree_node* %t1, %t2           ; <i1> [#uses=1]
60         br i1 %tmp198, label %bb201, label %UnifiedReturnBlock
61
62 bb201:          ; preds = %bb187
63         ret i32 0
64
65 UnifiedReturnBlock:             ; preds = %bb187, %bb153, %bb146.split, %entry
66         ret i32 0
67 }