xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/and-elim.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=ppc32 | not grep rlwin
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workerdefine void @test(i8* %P) {
4*9880d681SAndroid Build Coastguard Worker	%W = load i8, i8* %P
5*9880d681SAndroid Build Coastguard Worker	%X = shl i8 %W, 1
6*9880d681SAndroid Build Coastguard Worker	%Y = add i8 %X, 2
7*9880d681SAndroid Build Coastguard Worker	%Z = and i8 %Y, 254        ; dead and
8*9880d681SAndroid Build Coastguard Worker	store i8 %Z, i8* %P
9*9880d681SAndroid Build Coastguard Worker	ret void
10*9880d681SAndroid Build Coastguard Worker}
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Workerdefine zeroext i16 @test2(i16 zeroext %crc)  {
13*9880d681SAndroid Build Coastguard Worker        ; No and's should be needed for the i16s here.
14*9880d681SAndroid Build Coastguard Worker        %tmp.1 = lshr i16 %crc, 1
15*9880d681SAndroid Build Coastguard Worker        %tmp.7 = xor i16 %tmp.1, 40961
16*9880d681SAndroid Build Coastguard Worker        ret i16 %tmp.7
17*9880d681SAndroid Build Coastguard Worker}
18*9880d681SAndroid Build Coastguard Worker
19