reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
  155
  156
  157
  158
  159
  160
  161
  162
  163
  164
  165
  166
  167
  168
  169
  170
  171
  172
  173
  174
  175
  176
  177
  178
  179
  180
  181
  182
  183
  184
  185
  186
  187
  188
  189
  190
  191
  192
  193
  194
  195
  196
  197
  198
  199
  200
  201
  202
  203
  204
  205
  206
  207
  208
  209
  210
  211
  212
  213
  214
  215
  216
  217
  218
  219
  220
  221
  222
  223
  224
  225
  226
  227
  228
  229
  230
  231
  232
  233
  234
  235
  236
  237
  238
  239
  240
  241
  242
  243
  244
  245
  246
  247
  248
  249
  250
  251
  252
  253
  254
  255
  256
  257
  258
  259
  260
  261
  262
  263
  264
  265
  266
  267
  268
  269
  270
  271
  272
  273
  274
  275
  276
  277
  278
  279
  280
  281
  282
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -O3 -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown \
# RUN: -mcpu=pwr9 -simplify-mir -run-pass=machine-cp %s -o - | FileCheck %s


# Normal case
---
name: test0
alignment: 4
tracksRegLiveness: true
body: |
  bb.0.entry:
    ; CHECK-LABEL: name: test0
    ; CHECK: renamable $x4 = LI8 1024
    ; CHECK: $x3 = COPY killed renamable $x4
    ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
    renamable $x4 = LI8 1024
    $x3 = COPY renamable killed $x4
    BLR8 implicit $lr8, implicit undef $rm, implicit $x3

...

# Not in terminal BBs
---
name: test1
alignment: 4
tracksRegLiveness: true
body: |
  ; CHECK-LABEL: name: test1
  ; CHECK: bb.0.entry:
  ; CHECK:   renamable $x5 = LI8 42
  ; CHECK:   renamable $x4 = COPY killed renamable $x5
  ; CHECK:   B %bb.1
  ; CHECK: bb.1:
  ; CHECK:   liveins: $x4
  ; CHECK:   $x3 = COPY killed renamable $x4
  ; CHECK:   BLR8 implicit $lr8, implicit undef $rm, implicit $x3
  bb.0.entry:
    successors: %bb.1

    renamable $x5 = LI8 42
    renamable $x4 = COPY renamable killed $x5
    B %bb.1

  bb.1:
    liveins: $x4
    $x3 = COPY renamable killed $x4
    BLR8 implicit $lr8, implicit undef $rm, implicit $x3

...

# Use reserved register
---
name: test2
alignment: 4
tracksRegLiveness: true
body: |
  bb.0.entry:
    ; CHECK-LABEL: name: test2
    ; CHECK: renamable $x4 = LI8 1024
    ; CHECK: $x13 = COPY killed renamable $x4
    ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit undef $x3
    renamable $x4 = LI8 1024
    $x13 = COPY renamable killed $x4
    BLR8 implicit $lr8, implicit undef $rm, implicit undef $x3

...

# Intermediate read of copy's src
---
name: test3
alignment: 4
tracksRegLiveness: true
body: |
  bb.0.entry:
    ; CHECK-LABEL: name: test3
    ; CHECK: renamable $x4 = LI8 0
    ; CHECK: renamable $x5 = ADDI8 $x4, 1
    ; CHECK: $x3 = COPY killed renamable $x4
    ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
    renamable $x4 = LI8 0
    renamable $x5 = ADDI8 $x4, 1
    $x3 = COPY renamable killed $x4
    BLR8 implicit $lr8, implicit undef $rm, implicit $x3

...

# Intermediate read of copy's def
---
name: test4
alignment: 4
tracksRegLiveness: true
body: |
  bb.0.entry:
    liveins: $x3

    ; CHECK-LABEL: name: test4
    ; CHECK: liveins: $x3
    ; CHECK: renamable $x4 = LI8 0
    ; CHECK: renamable $x5 = ADDI8 $x3, 1
    ; CHECK: $x3 = COPY killed renamable $x4
    ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
    renamable $x4 = LI8 0
    renamable $x5 = ADDI8 $x3, 1
    $x3 = COPY renamable killed $x4
    BLR8 implicit $lr8, implicit undef $rm, implicit $x3

...

# Intermiediate clobber of copy's def
---
name: test5
alignment: 4
tracksRegLiveness: true
body: |
  bb.0.entry:
    liveins: $x3, $x5

    ; CHECK-LABEL: name: test5
    ; CHECK: liveins: $x3, $x5
    ; CHECK: renamable $x4 = LI8 0
    ; CHECK: renamable $x3 = ADDI8 $x5, 1
    ; CHECK: $x3 = COPY killed renamable $x4
    ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
    renamable $x4 = LI8 0
    renamable $x3 = ADDI8 $x5, 1
    $x3 = COPY renamable killed $x4
    BLR8 implicit $lr8, implicit undef $rm, implicit $x3

...

---
name: iterative_deletion
alignment: 4
tracksRegLiveness: true
body: |
  bb.0.entry:
    liveins: $x5

    ; CHECK-LABEL: name: iterative_deletion
    ; CHECK: liveins: $x5
    ; CHECK: renamable $x6 = ADDI8 killed renamable $x5, 1
    ; CHECK: $x3 = COPY $x6
    ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
    renamable $x6 = ADDI8 renamable killed $x5, 1
    renamable $x4 = COPY renamable killed $x6
    renamable $x7 = COPY renamable killed $x4
    $x3 = COPY renamable killed $x7
    BLR8 implicit $lr8, implicit undef $rm, implicit $x3

...

---
name: Enter
alignment: 4
tracksRegLiveness: true
body: |
  bb.0.entry:
    liveins: $x4, $x7
    ; CHECK-LABEL: name: Enter
    ; CHECK: liveins: $x4, $x7
    ; CHECK: renamable $x5 = COPY killed renamable $x7
    ; CHECK: renamable $x6 = ADDI8 killed renamable $x4, 1
    ; CHECK: $x3 = ADD8 killed renamable $x5, $x6
    ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
    renamable $x5 = COPY killed renamable $x7
    renamable $x6 = ADDI8 killed renamable $x4, 1
    renamable $x7 = COPY killed renamable $x6
    $x3 = ADD8 renamable killed $x5, renamable killed $x7
    BLR8 implicit $lr8, implicit undef $rm, implicit $x3

...

---
name: foo
alignment: 4
tracksRegLiveness: true
body: |
  bb.0.entry:
    liveins: $x4, $x7
    ; CHECK-LABEL: name: foo
    ; CHECK: liveins: $x4, $x7
    ; CHECK: renamable $x5 = COPY killed renamable $x7
    ; CHECK: renamable $x6 = ADDI8 renamable $x4, 1
    ; CHECK: renamable $x7 = COPY killed renamable $x6
    ; CHECK: renamable $x8 = ADDI8 killed $x4, 2
    ; CHECK: $x3 = ADD8 killed renamable $x5, $x8
    ; CHECK: $x3 = ADD8 $x3, killed renamable $x7
    ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
    renamable $x5 = COPY killed renamable $x7
    renamable $x6 = ADDI8 renamable $x4, 1
    renamable $x7 = COPY killed renamable $x6
    renamable $x8 = ADDI8 killed $x4, 2
    renamable $x6 = COPY killed renamable $x8
    $x3 = ADD8 renamable killed $x5, renamable killed $x6
    $x3 = ADD8 $x3, renamable killed $x7
    BLR8 implicit $lr8, implicit undef $rm, implicit $x3

...

---
name: bar
alignment: 4
tracksRegLiveness: true
body: |
  bb.0.entry:
    liveins: $x4, $x7
    ; CHECK-LABEL: name: bar
    ; CHECK: liveins: $x4, $x7
    ; CHECK: renamable $x5 = COPY killed renamable $x7
    ; CHECK: renamable $x6 = ADDI8 renamable $x4, 1
    ; CHECK: renamable $x8 = COPY $x6
    ; CHECK: renamable $x6 = ADDI8 renamable $x5, 2
    ; CHECK: $x3 = ADD8 killed renamable $x5, $x6
    ; CHECK: $x3 = ADD8 $x3, killed renamable $x8
    ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
    renamable $x5 = COPY killed renamable $x7
    renamable $x6 = ADDI8 renamable $x4, 1
    renamable $x7 = COPY killed renamable $x6
    renamable $x8 = COPY killed renamable $x7
    renamable $x6 = ADDI8 renamable $x5, 2
    renamable $x7 = COPY killed renamable $x6
    $x3 = ADD8 renamable killed $x5, renamable killed $x7
    $x3 = ADD8 $x3, renamable killed $x8
    BLR8 implicit $lr8, implicit undef $rm, implicit $x3

...

---
name: bogus
alignment: 4
tracksRegLiveness: true
body: |
  bb.0.entry:
    liveins: $x7
    ; CHECK-LABEL: name: bogus
    ; CHECK: liveins: $x7
    ; CHECK: renamable $x5 = COPY renamable $x7
    ; CHECK: renamable $x6 = ADDI8 $x7, 1
    ; CHECK: renamable $x7 = COPY $x6
    ; CHECK: renamable $x6 = ADDI8 renamable $x5, 2
    ; CHECK: $x3 = ADD8 $x7, killed renamable $x5
    ; CHECK: $x3 = ADD8 $x3, killed renamable $x6
    ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
    renamable $x5 = COPY killed renamable $x7
    renamable $x6 = ADDI8 renamable $x5, 1
    renamable $x4 = COPY killed renamable $x6
    renamable $x7 = COPY killed renamable $x4
    renamable $x6 = ADDI8 renamable $x5, 2
    renamable $x4 = COPY killed renamable $x7
    $x3 = ADD8 renamable killed $x4, renamable killed $x5
    $x3 = ADD8 $x3, renamable killed $x6
    BLR8 implicit $lr8, implicit undef $rm, implicit $x3

...

---
name: foobar
alignment: 4
tracksRegLiveness: true
body: |
  bb.0.entry:
    liveins: $x7
    ; CHECK-LABEL: name: foobar
    ; CHECK: liveins: $x7
    ; CHECK: renamable $x6 = ADDI8 $x7, 1
    ; CHECK: renamable $x8 = COPY $x6
    ; CHECK: renamable $x6 = ADDI8 $x7, 2
    ; CHECK: $x3 = ADD8 $x6, $x7
    ; CHECK: $x3 = ADD8 $x3, killed renamable $x8
    ; CHECK: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
    renamable $x5 = COPY killed renamable $x7
    renamable $x6 = ADDI8 renamable $x5, 1
    renamable $x4 = COPY killed renamable $x6
    renamable $x8 = COPY killed renamable $x4
    renamable $x6 = ADDI8 renamable $x5, 2
    renamable $x4 = COPY killed renamable $x6
    $x3 = ADD8 renamable killed $x4, renamable killed $x5
    $x3 = ADD8 $x3, renamable killed $x8
    BLR8 implicit $lr8, implicit undef $rm, implicit $x3

...