1 ; RUN: llc < %s -mcpu=generic -mtriple=i686-- -post-RA-scheduler=false | FileCheck %s
4 ; LLVM should omit the testl and use the flags result from the orl.
7 define void @or(float* %A, i32 %IA, i32 %N) nounwind {
9 %0 = ptrtoint float* %A to i32 ; <i32> [#uses=1]
10 %1 = and i32 %0, 3 ; <i32> [#uses=1]
11 %2 = xor i32 %IA, 1 ; <i32> [#uses=1]
14 %3 = or i32 %2, %1 ; <i32> [#uses=1]
15 %4 = icmp eq i32 %3, 0 ; <i1> [#uses=1]
16 br i1 %4, label %return, label %bb
19 store float 0.000000e+00, float* %A, align 4
22 return: ; preds = %entry
26 define void @xor(float* %A, i32 %IA, i32 %N) nounwind {
28 %0 = ptrtoint float* %A to i32 ; <i32> [#uses=1]
29 %1 = and i32 %0, 3 ; <i32> [#uses=1]
32 %2 = xor i32 %IA, 1 ; <i32> [#uses=1]
33 %3 = xor i32 %2, %1 ; <i32> [#uses=1]
34 %4 = icmp eq i32 %3, 0 ; <i1> [#uses=1]
35 br i1 %4, label %return, label %bb
38 store float 0.000000e+00, float* %A, align 4
41 return: ; preds = %entry
45 define void @and(float* %A, i32 %IA, i32 %N, i8* %p) nounwind {
48 %0 = ptrtoint float* %A to i32 ; <i32> [#uses=1]
49 %1 = and i32 %0, 3 ; <i32> [#uses=1]
50 %2 = xor i32 %IA, 1 ; <i32> [#uses=1]
54 %3 = and i32 %2, %1 ; <i32> [#uses=1]
55 %t = trunc i32 %3 to i8
57 %4 = icmp eq i32 %3, 0 ; <i1> [#uses=1]
58 br i1 %4, label %return, label %bb
61 store float 0.000000e+00, float* null, align 4
64 return: ; preds = %entry
68 ; Just like @and, but without the trunc+store. This should use a testb
71 define void @test(float* %A, i32 %IA, i32 %N, i8* %p) nounwind {
74 %0 = ptrtoint float* %A to i32 ; <i32> [#uses=1]
75 %1 = and i32 %0, 3 ; <i32> [#uses=1]
76 %2 = xor i32 %IA, 1 ; <i32> [#uses=1]
79 %3 = and i32 %2, %1 ; <i32> [#uses=1]
80 %4 = icmp eq i32 %3, 0 ; <i1> [#uses=1]
81 br i1 %4, label %return, label %bb
84 store float 0.000000e+00, float* null, align 4
87 return: ; preds = %entry