32 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; This test case checks that the merge of and/xor can work on arbitrary3; precision integers.4 5; RUN: opt < %s -passes=instcombine -S | FileCheck %s6 7; (x &z ) ^ (y & z) -> (x ^ y) & z8define i57 @test1(i57 %x, i57 %y, i57 %z) {9; CHECK-LABEL: @test1(10; CHECK-NEXT: [[TMP61:%.*]] = xor i57 [[X:%.*]], [[Y:%.*]]11; CHECK-NEXT: [[TMP7:%.*]] = and i57 [[Z:%.*]], [[TMP61]]12; CHECK-NEXT: ret i57 [[TMP7]]13;14 %tmp3 = and i57 %z, %x15 %tmp6 = and i57 %z, %y16 %tmp7 = xor i57 %tmp3, %tmp617 ret i57 %tmp718}19 20; (x & y) ^ (x | y) -> x ^ y21define 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]]25;26 %tmp3 = and i23 %y, %x27 %tmp6 = or i23 %y, %x28 %tmp7 = xor i23 %tmp3, %tmp629 ret i23 %tmp730}31 32