1 ; RUN: opt < %s -instsimplify -S | FileCheck %s
3 define i32 @factorize(i32 %x, i32 %y) {
5 ; (X | 1) & (X | 2) -> X | (1 & 2) -> X
13 define i32 @factorize2(i32 %x) {
23 define i32 @factorize3(i32 %x, i32 %a, i32 %b) {
25 ; (X | (A|B)) & (X | B) -> X | ((A|B) & B) -> X | B
34 define i32 @expand(i32 %x) {
36 ; ((X & 1) | 2) & 1 -> ((X & 1) & 1) | (2 & 1) -> (X & 1) | 0 -> X & 1