Delete the label names from this test to make it less fragile.
[oota-llvm.git] / test / CodeGen / X86 / peep-test-3.ll
1 ; RUN: llc < %s -march=x86 | FileCheck %s
2
3 ; LLVM should omit the testl and use the flags result from the orl.
4
5 ; CHECK: or:
6 define void @or(float* %A, i32 %IA, i32 %N) nounwind {
7 entry:
8   %0 = ptrtoint float* %A to i32                  ; <i32> [#uses=1]
9   %1 = and i32 %0, 3                              ; <i32> [#uses=1]
10   %2 = xor i32 %IA, 1                             ; <i32> [#uses=1]
11 ; CHECK:      orl %ecx, %edx
12 ; CHECK-NEXT: je
13   %3 = or i32 %2, %1                              ; <i32> [#uses=1]
14   %4 = icmp eq i32 %3, 0                          ; <i1> [#uses=1]
15   br i1 %4, label %return, label %bb
16
17 bb:                                               ; preds = %entry
18   store float 0.000000e+00, float* %A, align 4
19   ret void
20
21 return:                                           ; preds = %entry
22   ret void
23 }
24 ; CHECK: xor:
25 define void @xor(float* %A, i32 %IA, i32 %N) nounwind {
26 entry:
27   %0 = ptrtoint float* %A to i32                  ; <i32> [#uses=1]
28   %1 = and i32 %0, 3                              ; <i32> [#uses=1]
29 ; CHECK:      xorl $1, %e
30 ; CHECK-NEXT: je
31   %2 = xor i32 %IA, 1                             ; <i32> [#uses=1]
32   %3 = xor i32 %2, %1                              ; <i32> [#uses=1]
33   %4 = icmp eq i32 %3, 0                          ; <i1> [#uses=1]
34   br i1 %4, label %return, label %bb
35
36 bb:                                               ; preds = %entry
37   store float 0.000000e+00, float* %A, align 4
38   ret void
39
40 return:                                           ; preds = %entry
41   ret void
42 }
43 ; CHECK: and:
44 define void @and(float* %A, i32 %IA, i32 %N, i8* %p) nounwind {
45 entry:
46   store i8 0, i8* %p
47   %0 = ptrtoint float* %A to i32                  ; <i32> [#uses=1]
48   %1 = and i32 %0, 3                              ; <i32> [#uses=1]
49   %2 = xor i32 %IA, 1                             ; <i32> [#uses=1]
50 ; CHECK:      andl  $3, %
51 ; CHECK-NEXT: movb  %
52 ; CHECK-NEXT: je
53   %3 = and i32 %2, %1                              ; <i32> [#uses=1]
54   %t = trunc i32 %3 to i8
55   store i8 %t, i8* %p
56   %4 = icmp eq i32 %3, 0                          ; <i1> [#uses=1]
57   br i1 %4, label %return, label %bb
58
59 bb:                                               ; preds = %entry
60   store float 0.000000e+00, float* null, align 4
61   ret void
62
63 return:                                           ; preds = %entry
64   ret void
65 }
66
67 ; Just like @and, but without the trunc+store. This should use a testl
68 ; instead of an andl.
69 ; CHECK: test:
70 define void @test(float* %A, i32 %IA, i32 %N, i8* %p) nounwind {
71 entry:
72   store i8 0, i8* %p
73   %0 = ptrtoint float* %A to i32                  ; <i32> [#uses=1]
74   %1 = and i32 %0, 3                              ; <i32> [#uses=1]
75   %2 = xor i32 %IA, 1                             ; <i32> [#uses=1]
76 ; CHECK:      testb $3, %
77 ; CHECK-NEXT: je
78   %3 = and i32 %2, %1                              ; <i32> [#uses=1]
79   %4 = icmp eq i32 %3, 0                          ; <i1> [#uses=1]
80   br i1 %4, label %return, label %bb
81
82 bb:                                               ; preds = %entry
83   store float 0.000000e+00, float* null, align 4
84   ret void
85
86 return:                                           ; preds = %entry
87   ret void
88 }