1 ; This file contains various testcases that require tracking whether bits are
2 ; set or cleared by various instructions.
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -instcombine | llvm-dis |\
6 ; Reduce down to a single XOR
8 %ELIMinc = and int %B, 1
9 %tmp.5 = xor int %ELIMinc, 1
10 %ELIM7 = and int %B, -2
11 %tmp.8 = or int %tmp.5, %ELIM7
15 ; Finally, a bigger case where we chain things together. This corresponds to
16 ; incrementing a single-bit bitfield, which should become just an xor.
18 %ELIM3 = shl int %B, ubyte 31
19 %ELIM4 = shr int %ELIM3, ubyte 31
20 %inc = add int %ELIM4, 1
21 %ELIM5 = and int %inc, 1
22 %ELIM7 = and int %B, -2
23 %tmp.8 = or int %ELIM5, %ELIM7