xref: /aosp_15_r20/external/llvm/test/CodeGen/SystemZ/int-cmp-51.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Check that modelling of CC/CCRegs does not stop MachineCSE from
2*9880d681SAndroid Build Coastguard Worker; removing a compare.  MachineCSE will not extend a live range of an
3*9880d681SAndroid Build Coastguard Worker; allocatable or reserved phys reg.
4*9880d681SAndroid Build Coastguard Worker;
5*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdeclare void @bar(i8)
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker; Check the low end of the CH range.
10*9880d681SAndroid Build Coastguard Workerdefine void @f1(i32 %lhs) {
11*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: BB#1:
12*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: cijlh %r0, 1, .LBB0_3
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerentry:
15*9880d681SAndroid Build Coastguard Worker  %and188 = and i32 %lhs, 255
16*9880d681SAndroid Build Coastguard Worker  %cmp189 = icmp ult i32 %and188, 2
17*9880d681SAndroid Build Coastguard Worker  br i1 %cmp189, label %if.then.191, label %if.else.201
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Workerif.then.191:
20*9880d681SAndroid Build Coastguard Worker  %cmp194 = icmp eq i32 %and188, 1
21*9880d681SAndroid Build Coastguard Worker  br i1 %cmp194, label %if.then.196, label %if.else.198
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Workerif.then.196:
24*9880d681SAndroid Build Coastguard Worker  call void @bar(i8 1);
25*9880d681SAndroid Build Coastguard Worker  br label %if.else.201
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Workerif.else.198:
28*9880d681SAndroid Build Coastguard Worker  call void @bar(i8 0);
29*9880d681SAndroid Build Coastguard Worker  br label %if.else.201
30*9880d681SAndroid Build Coastguard Worker
31*9880d681SAndroid Build Coastguard Workerif.else.201:
32*9880d681SAndroid Build Coastguard Worker  ret void
33*9880d681SAndroid Build Coastguard Worker}
34*9880d681SAndroid Build Coastguard Worker
35