1 ; RUN: opt < %s -instsimplify -S | FileCheck %s
3 define i32 @factorize(i32 %x, i32 %y) {
4 ; CHECK-LABEL: @factorize(
5 ; (X | 1) & (X | 2) -> X | (1 & 2) -> X
13 define i32 @factorize2(i32 %x) {
14 ; CHECK-LABEL: @factorize2(
23 define i32 @factorize3(i32 %x, i32 %a, i32 %b) {
24 ; CHECK-LABEL: @factorize3(
25 ; (X | (A|B)) & (X | B) -> X | ((A|B) & B) -> X | B
34 define i32 @factorize4(i32 %x, i32 %y) {
35 ; CHECK-LABEL: @factorize4(
44 define i32 @factorize5(i32 %x, i32 %y) {
45 ; CHECK-LABEL: @factorize5(
54 define i32 @expand(i32 %x) {
55 ; CHECK-LABEL: @expand(
56 ; ((X & 1) | 2) & 1 -> ((X & 1) & 1) | (2 & 1) -> (X & 1) | 0 -> X & 1