1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-- | FileCheck %s
4 ; Don't duplicate the load.
6 define fastcc i32 @foo(ptr %p) nounwind {
9 ; CHECK-NEXT: movl (%ecx), %eax
10 ; CHECK-NEXT: andl $10, %eax
11 ; CHECK-NEXT: je .LBB0_2
12 ; CHECK-NEXT: # %bb.1: # %bb63
14 ; CHECK-NEXT: .LBB0_2: # %bb76
15 ; CHECK-NEXT: xorl %eax, %eax
17 %t0 = load i32, ptr %p
19 %t3 = icmp ne i32 %t2, 0
20 br i1 %t3, label %bb63, label %bb76
27 define fastcc double @bar(i32 %hash, double %x, double %y) nounwind {
29 ; CHECK: # %bb.0: # %entry
30 ; CHECK-NEXT: pushl %ebp
31 ; CHECK-NEXT: movl %esp, %ebp
32 ; CHECK-NEXT: andl $-8, %esp
33 ; CHECK-NEXT: fldl 16(%ebp)
34 ; CHECK-NEXT: fldl 8(%ebp)
35 ; CHECK-NEXT: movl %ecx, %eax
36 ; CHECK-NEXT: andl $15, %eax
37 ; CHECK-NEXT: cmpl $8, %eax
38 ; CHECK-NEXT: jb .LBB1_2
39 ; CHECK-NEXT: # %bb.1: # %bb10
40 ; CHECK-NEXT: testb $1, %cl
41 ; CHECK-NEXT: je .LBB1_3
42 ; CHECK-NEXT: .LBB1_2: # %bb11
44 ; CHECK-NEXT: .LBB1_3: # %bb13
45 ; CHECK-NEXT: testb $2, %cl
46 ; CHECK-NEXT: je .LBB1_5
47 ; CHECK-NEXT: # %bb.4: # %bb14
48 ; CHECK-NEXT: fxch %st(1)
50 ; CHECK-NEXT: fxch %st(1)
51 ; CHECK-NEXT: .LBB1_5: # %bb16
52 ; CHECK-NEXT: faddp %st, %st(1)
53 ; CHECK-NEXT: movl %ebp, %esp
54 ; CHECK-NEXT: popl %ebp
57 %0 = and i32 %hash, 15
58 %1 = icmp ult i32 %0, 8
59 br i1 %1, label %bb11, label %bb10
63 %3 = icmp eq i32 %2, 0
64 br i1 %3, label %bb13, label %bb11
67 %4 = fsub double -0.000000e+00, %x
71 %iftmp.9.0 = phi double [ %4, %bb11 ], [ %x, %bb10 ]
73 %6 = icmp eq i32 %5, 0
74 br i1 %6, label %bb16, label %bb14
77 %7 = fsub double -0.000000e+00, %y
81 %iftmp.10.0 = phi double [ %7, %bb14 ], [ %y, %bb13 ]
82 %8 = fadd double %iftmp.9.0, %iftmp.10.0