1; RUN: opt < %s -instcombine -S | grep "xor i32 %a, %b" | count 4 2; RUN: opt < %s -instcombine -S | not grep "and" 3 4define i32 @func1(i32 %a, i32 %b) nounwind readnone { 5entry: 6 %b_not = xor i32 %b, -1 7 %0 = and i32 %a, %b_not 8 %a_not = xor i32 %a, -1 9 %1 = and i32 %a_not, %b 10 %2 = or i32 %0, %1 11 ret i32 %2 12} 13 14define i32 @func2(i32 %a, i32 %b) nounwind readnone { 15entry: 16 %b_not = xor i32 %b, -1 17 %0 = and i32 %b_not, %a 18 %a_not = xor i32 %a, -1 19 %1 = and i32 %a_not, %b 20 %2 = or i32 %0, %1 21 ret i32 %2 22} 23 24define i32 @func3(i32 %a, i32 %b) nounwind readnone { 25entry: 26 %b_not = xor i32 %b, -1 27 %0 = and i32 %a, %b_not 28 %a_not = xor i32 %a, -1 29 %1 = and i32 %b, %a_not 30 %2 = or i32 %0, %1 31 ret i32 %2 32} 33 34define i32 @func4(i32 %a, i32 %b) nounwind readnone { 35entry: 36 %b_not = xor i32 %b, -1 37 %0 = and i32 %b_not, %a 38 %a_not = xor i32 %a, -1 39 %1 = and i32 %b, %a_not 40 %2 = or i32 %0, %1 41 ret i32 %2 42} 43