Home | History | Annotate | Download | only in InstCombine
      1 ; RUN: opt < %s -instcombine -S | FileCheck %s
      2 
      3 ; rdar://10770603
      4 ; (x & y) | (x ^ y) -> x | y 
      5 define i64 @or(i64 %x, i64 %y) nounwind uwtable readnone ssp {
      6   %1 = and i64 %y, %x
      7   %2 = xor i64 %y, %x
      8   %3 = add i64 %1, %2
      9   ret i64 %3
     10 ; CHECK-LABEL: @or(
     11 ; CHECK: or i64
     12 ; CHECK-NEXT: ret
     13 }
     14 
     15 ; (x & y) + (x ^ y) -> x | y 
     16 define i64 @or2(i64 %x, i64 %y) nounwind uwtable readnone ssp {
     17   %1 = and i64 %y, %x
     18   %2 = xor i64 %y, %x
     19   %3 = or i64 %1, %2
     20   ret i64 %3
     21 ; CHECK-LABEL: @or2(
     22 ; CHECK: or i64
     23 ; CHECK-NEXT: ret
     24 }
     25