1 ; This test makes sure that xor instructions are properly eliminated.
2 ; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
4 ; RUN: opt < %s -passes=instcombine -S | not grep "xor "
7 define i47 @test1(i47 %A, i47 %B) {
8 ;; (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
9 %A1 = and i47 %A, 70368744177664
10 %B1 = and i47 %B, 70368744177661
11 %C1 = xor i47 %A1, %B1
15 define i15 @test2(i15 %x) {
16 %tmp.2 = xor i15 %x, 0
20 define i23 @test3(i23 %x) {
21 %tmp.2 = xor i23 %x, %x
25 define i37 @test4(i37 %x) {
27 %NotX = xor i37 -1, %x
28 %B = xor i37 %x, %NotX
32 define i7 @test5(i7 %A) {
33 ;; (A|B)^B == A & (~B)
39 define i7 @test6(i7 %A) {
45 define i47 @test7(i47 %A) {
46 ;; (A | C1) ^ C2 -> (A | C1) & ~C2 iff (C1&C2) == C2
47 %B1 = or i47 %A, 70368744177663
48 %C1 = xor i47 %B1, 703687463