xref: /llvm-project/llvm/test/CodeGen/SystemZ/cond-move-04.mir (revision 16b7cc69ef43110c9776212379ccc37d7d3263c0)
1# RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 -start-before=greedy %s -o - \
2# RUN:   | FileCheck %s
3#
4# Test that regalloc manages (via regalloc hints) to avoid a LOCRMux jump
5# sequence expansion.
6
7--- |
8
9  declare ptr @foo(ptr, i32 signext, i32 signext) local_unnamed_addr
10
11  define ptr @fun(ptr returned) {
12    br label %2
13
14  ; <label>:2:                                      ; preds = %6, %1
15    %3 = zext i16 undef to i32
16    switch i32 %3, label %4 [
17      i32 15, label %6
18      i32 125, label %5
19    ]
20
21  ; <label>:4:                                      ; preds = %2
22    br label %6
23
24  ; <label>:5:                                      ; preds = %2
25    br label %6
26
27  ; <label>:6:                                      ; preds = %5, %4, %2
28    %7 = phi i32 [ 4, %2 ], [ undef, %4 ], [ 10, %5 ]
29    %8 = call ptr @foo(ptr undef, i32 signext undef, i32 signext %7)
30    br label %2
31  }
32
33...
34
35# CHECK: locr
36# CHECK-NOT: risblg
37
38---
39name:            fun
40alignment:       4
41tracksRegLiveness: true
42registers:
43  - { id: 0, class: gr32bit }
44  - { id: 1, class: gr64bit }
45  - { id: 2, class: grx32bit }
46  - { id: 3, class: grx32bit }
47  - { id: 4, class: grx32bit }
48  - { id: 5, class: grx32bit }
49  - { id: 6, class: grx32bit }
50  - { id: 7, class: gr64bit }
51  - { id: 8, class: gr64bit }
52  - { id: 9, class: gr64bit }
53  - { id: 10, class: gr64bit }
54  - { id: 11, class: gr32bit }
55frameInfo:
56  adjustsStack:    true
57  hasCalls:        true
58body:             |
59  bb.0 (%ir-block.1):
60    %3 = LHIMux 0
61    %2 = LHIMux 4
62    %5 = LHIMux 10
63
64  bb.1 (%ir-block.2):
65    CHIMux %3, 0, implicit-def $cc
66    %0 = LOCRMux undef %0, %5, 14, 6, implicit $cc
67    %0 = LOCRMux %0, %2, 14, 6, implicit killed $cc
68    %7 = LGFR %0
69    $r3d = LGHI 0
70    $r4d = COPY %7
71    CallBRASL @foo, undef $r2d, killed $r3d, killed $r4d, csr_systemz_elf, implicit-def dead $r14d, implicit-def dead $cc, implicit-def dead $r2d
72    J %bb.1
73
74...
75