Home | History | Annotate | Download | only in InstCombine
      1 ; RUN: opt < %s -instcombine -S | grep and | count 1
      2 ; RUN: opt < %s -instcombine -S | grep xor | count 2
      3 
      4 ; (x&z) ^ (y&z) -> (x^y)&z
      5 define i32 @test1(i32 %x, i32 %y, i32 %z) {
      6         %tmp3 = and i32 %z, %x
      7         %tmp6 = and i32 %z, %y
      8         %tmp7 = xor i32 %tmp3, %tmp6
      9         ret i32 %tmp7
     10 }
     11 
     12 ; (x & y) ^ (x|y) -> x^y
     13 define i32 @test2(i32 %x, i32 %y, i32 %z) {
     14         %tmp3 = and i32 %y, %x
     15         %tmp6 = or i32 %y, %x
     16         %tmp7 = xor i32 %tmp3, %tmp6
     17         ret i32 %tmp7
     18 }
     19 
     20