Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -march=x86 | FileCheck %s
      2 
      3 ; Don't duplicate the load.
      4 
      5 define fastcc i32 @foo(i32* %p) nounwind {
      6 ; CHECK-LABEL: foo:
      7 ; CHECK: andl $10, %eax
      8 ; CHECK: je
      9 	%t0 = load i32* %p
     10 	%t2 = and i32 %t0, 10
     11 	%t3 = icmp ne i32 %t2, 0
     12 	br i1 %t3, label %bb63, label %bb76
     13 bb63:
     14 	ret i32 %t2
     15 bb76:
     16 	ret i32 0
     17 }
     18 
     19 define fastcc double @bar(i32 %hash, double %x, double %y) nounwind {
     20 entry:
     21 ; CHECK-LABEL: bar:
     22   %0 = and i32 %hash, 15
     23   %1 = icmp ult i32 %0, 8
     24   br i1 %1, label %bb11, label %bb10
     25 
     26 bb10:
     27 ; CHECK: bb10
     28 ; CHECK: testb $1
     29   %2 = and i32 %hash, 1
     30   %3 = icmp eq i32 %2, 0
     31   br i1 %3, label %bb13, label %bb11
     32 
     33 bb11:
     34   %4 = fsub double -0.000000e+00, %x
     35   br label %bb13
     36 
     37 bb13:
     38 ; CHECK: bb13
     39 ; CHECK: testb $2
     40   %iftmp.9.0 = phi double [ %4, %bb11 ], [ %x, %bb10 ]
     41   %5 = and i32 %hash, 2
     42   %6 = icmp eq i32 %5, 0
     43   br i1 %6, label %bb16, label %bb14
     44 
     45 bb14:
     46   %7 = fsub double -0.000000e+00, %y
     47   br label %bb16
     48 
     49 bb16:
     50   %iftmp.10.0 = phi double [ %7, %bb14 ], [ %y, %bb13 ]
     51   %8 = fadd double %iftmp.9.0, %iftmp.10.0
     52   ret double %8
     53 }
     54