1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; This test case checks that the merge of and/xor can work on arbitrary
5 ; RUN: opt < %s -passes=instcombine -S | FileCheck %s
7 ; (x &z ) ^ (y & z) -> (x ^ y) & z
8 define i57 @test1(i57 %x, i57 %y, i57 %z) {
10 ; CHECK-NEXT: [[TMP61:%.*]] = xor i57 [[X:%.*]], [[Y:%.*]]
11 ; CHECK-NEXT: [[TMP7:%.*]] = and i57 [[Z:%.*]], [[TMP61]]
12 ; CHECK-NEXT: ret i57 [[TMP7]]
14 %tmp3 = and i57 %z, %x
15 %tmp6 = and i57 %z, %y
16 %tmp7 = xor i57 %tmp3, %tmp6
20 ; (x & y) ^ (x | y) -> x ^ y
21 define i23 @test2(i23 %x, i23 %y, i23 %z) {
22 ; CHECK-LABEL: @test2(
23 ; CHECK-NEXT: [[TMP7:%.*]] = xor i23 [[Y:%.*]], [[X:%.*]]
24 ; CHECK-NEXT: ret i23 [[TMP7]]
26 %tmp3 = and i23 %y, %x
28 %tmp7 = xor i23 %tmp3, %tmp6