1# RUN: llc -mtriple=s390x-linux-gnu -mcpu=z14 -start-before=postrapseudos %s \
2# RUN:   -o - | FileCheck %s
3#
4# Test that the CC values of logical adds and subs can be used in compare
5# elimination in the cases of EQ/NE.
6
7# CHECK-LABEL:  fun0:
8# CHECK:	alr	%r3, %r2
9# CHECK-NEXT:	locrhe	%r2, %r3
10# CHECK-NEXT:	alr	%r3, %r2
11# CHECK-NEXT:	locrnhe	%r2, %r3
12# CHECK-NEXT:	alr	%r3, %r2
13# CHECK-NEXT:	chi	%r3, 0
14# CHECK-NEXT:	locrle	%r2, %r3
15# CHECK-NEXT:	alr	%r3, %r2
16# CHECK-NEXT:	chi	%r3, 0
17# CHECK-NEXT:	locrhe	%r2, %r3
18# CHECK-NEXT:	slrk	%r3, %r2, %r3
19# CHECK-NEXT:	locrh	%r2, %r3
20# CHECK-NEXT:	slrk	%r3, %r2, %r3
21# CHECK-NEXT:	locrnhe	%r2, %r3
22# CHECK-NEXT:	slrk	%r3, %r2, %r3
23# CHECK-NEXT:	chi	%r3, 0
24# CHECK-NEXT:	locrle	%r2, %r3
25# CHECK-NEXT:	slrk	%r3, %r2, %r3
26# CHECK-NEXT:	chi	%r3, 0
27# CHECK-NEXT:	locrhe	%r2, %r3
28
29
30--- |
31  define i32 @fun0(i32 %arg1, i32 %arg2) { bb: ret i32 0  }
32...
33---
34name:            fun0
35body:             |
36  bb.0:
37
38    renamable $r3l = ALRK renamable $r2l, killed renamable $r3l, implicit-def dead $cc
39    CHIMux renamable $r3l, 0, implicit-def $cc
40    renamable $r2l = LOCR killed renamable $r2l, killed renamable $r3l, 14, 8, implicit killed $cc
41
42    renamable $r3l = ALRK renamable $r2l, killed renamable $r3l, implicit-def dead $cc
43    CHIMux renamable $r3l, 0, implicit-def $cc
44    renamable $r2l = LOCR killed renamable $r2l, killed renamable $r3l, 14, 6, implicit killed $cc
45
46    renamable $r3l = ALRK renamable $r2l, killed renamable $r3l, implicit-def dead $cc
47    CHIMux renamable $r3l, 0, implicit-def $cc
48    renamable $r2l = LOCR killed renamable $r2l, killed renamable $r3l, 14, 12, implicit killed $cc
49
50    renamable $r3l = ALRK renamable $r2l, killed renamable $r3l, implicit-def dead $cc
51    CHIMux renamable $r3l, 0, implicit-def $cc
52    renamable $r2l = LOCR killed renamable $r2l, killed renamable $r3l, 14, 10, implicit killed $cc
53
54    renamable $r3l = SLRK renamable $r2l, killed renamable $r3l, implicit-def dead $cc
55    CHIMux renamable $r3l, 0, implicit-def $cc
56    renamable $r2l = LOCR killed renamable $r2l, killed renamable $r3l, 14, 8, implicit killed $cc
57
58    renamable $r3l = SLRK renamable $r2l, killed renamable $r3l, implicit-def dead $cc
59    CHIMux renamable $r3l, 0, implicit-def $cc
60    renamable $r2l = LOCR killed renamable $r2l, killed renamable $r3l, 14, 6, implicit killed $cc
61
62    renamable $r3l = SLRK renamable $r2l, killed renamable $r3l, implicit-def dead $cc
63    CHIMux renamable $r3l, 0, implicit-def $cc
64    renamable $r2l = LOCR killed renamable $r2l, killed renamable $r3l, 14, 12, implicit killed $cc
65
66    renamable $r3l = SLRK renamable $r2l, killed renamable $r3l, implicit-def dead $cc
67    CHIMux renamable $r3l, 0, implicit-def $cc
68    renamable $r2l = LOCR killed renamable $r2l, killed renamable $r3l, 14, 10, implicit killed $cc
69
70    Return implicit $r2l
71...
72