1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefix=X86 3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64 4 5 define i32 @PR15705(i32 %x, i32 %a, i32 %b, i32 %c) #0 { 6 ; X86-LABEL: PR15705: 7 ; X86: # %bb.0: # %entry 8 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax 9 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx 10 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx 11 ; X86-NEXT: cmpl %ecx, %edx 12 ; X86-NEXT: je .LBB0_4 13 ; X86-NEXT: # %bb.1: # %if.end 14 ; X86-NEXT: cmpl %eax, %edx 15 ; X86-NEXT: jne .LBB0_3 16 ; X86-NEXT: # %bb.2: 17 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx 18 ; X86-NEXT: .LBB0_3: # %if.end 19 ; X86-NEXT: movl %ecx, %eax 20 ; X86-NEXT: .LBB0_4: # %return 21 ; X86-NEXT: retl 22 ; 23 ; X64-LABEL: PR15705: 24 ; X64: # %bb.0: # %entry 25 ; X64-NEXT: cmpl %esi, %edi 26 ; X64-NEXT: je .LBB0_2 27 ; X64-NEXT: # %bb.1: # %if.end 28 ; X64-NEXT: cmpl %edx, %edi 29 ; X64-NEXT: cmovel %ecx, %esi 30 ; X64-NEXT: movl %esi, %edx 31 ; X64-NEXT: .LBB0_2: # %return 32 ; X64-NEXT: movl %edx, %eax 33 ; X64-NEXT: retq 34 entry: 35 %cmp = icmp eq i32 %x, %a 36 br i1 %cmp, label %return, label %if.end 37 38 if.end: 39 %cmp1 = icmp eq i32 %x, %b 40 %c.a = select i1 %cmp1, i32 %c, i32 %a 41 br label %return 42 43 return: 44 %retval.0 = phi i32 [ %b, %entry ], [ %c.a, %if.end ] 45 ret i32 %retval.0 46 } 47 48 attributes #0 = { nounwind readnone ssp "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } 49