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
# RUN: llc -run-pass arm-prera-ldst-opt %s -o - | FileCheck %s
# RUN: llc -run-pass arm-prera-ldst-opt -arm-prera-ldst-opt-reorder-limit=3 %s -o - | FileCheck %s
# RUN: llc -run-pass arm-prera-ldst-opt -arm-prera-ldst-opt-reorder-limit=2 %s -o - | FileCheck %s --check-prefix=CHECK-LIMIT
--- |
  target triple = "thumbv7---eabi"

  define void @a(i32* nocapture %x, i32 %y, i32 %z) {
  entry:
    ret void
  }

  define void @b(i32* nocapture %x, i32 %y, i32 %z) {
  entry:
    ret void
  }
...
---
# CHECK-LABEL: name: a
name:            a
alignment:       2
tracksRegLiveness: true
liveins:
  - { reg: '$r0', virtual-reg: '%0' }
  - { reg: '$r1', virtual-reg: '%1' }
  - { reg: '$r2', virtual-reg: '%2' }
body:             |
  bb.0.entry:
    liveins: $r0, $r1, $r2

    %2 : rgpr = COPY $r2
    %1 : rgpr = COPY $r1
    %0 : gpr = COPY $r0
    %3 : rgpr = t2MUL %2, %2, 14, $noreg
    %4 : rgpr = t2MUL %1, %1, 14, $noreg
    %5 : rgpr = t2MOVi32imm -858993459
    %6 : rgpr, %7 : rgpr  = t2UMULL killed %3, %5, 14, $noreg
    %8 : rgpr, %9 : rgpr  = t2UMULL killed %4, %5, 14, $noreg
    t2STRi12 %1, %0, 0, 14, $noreg :: (store 4)
    %10 : rgpr = t2LSLri %2, 1, 14, $noreg, $noreg
    t2STRi12 killed %10, %0, 4, 14, $noreg :: (store 4)

    ; Make sure we move the paired stores next to each other, and
    ; insert them in an appropriate location.
    ; CHECK: t2STRi12 %1,
    ; CHECK-NEXT: t2STRi12 killed %10,
    ; CHECK-NEXT: t2MOVi
    ; CHECK-NEXT: t2ADDrs

    %11 : rgpr = t2MOVi 55, 14, $noreg, $noreg
    %12 : gprnopc = t2ADDrs %11, killed %7, 19, 14, $noreg, $noreg
    t2STRi12 killed %12, %0, 16, 14, $noreg :: (store 4)
    %13 : gprnopc = t2ADDrs %11, killed %9, 19, 14, $noreg, $noreg
    t2STRi12 killed %13, %0, 20, 14, $noreg :: (store 4)

    ; Make sure we move the paired stores next to each other.
    ; CHECK: t2STRi12 killed %12,
    ; CHECK-NEXT: t2STRi12 killed %13,

    tBX_RET 14, $noreg
---
# CHECK-LABEL: name: b
name:            b
alignment:       2
tracksRegLiveness: true
liveins:
  - { reg: '$r0', virtual-reg: '%0' }
  - { reg: '$r1', virtual-reg: '%1' }
  - { reg: '$r2', virtual-reg: '%2' }
body:             |
  bb.0.entry:
    liveins: $r0, $r1, $r2

    %2 : rgpr = COPY $r2
    %1 : rgpr = COPY $r1
    %0 : gpr = COPY $r0
    t2STRi12 %1, %0, 0, 14, $noreg :: (store 4)
    %10 : rgpr = t2LSLri %2, 1, 14, $noreg, $noreg
    t2STRi12 killed %10, %0, 4, 14, $noreg :: (store 4)
    %3 : rgpr = t2MUL %2, %2, 14, $noreg
    t2STRi12 %3, %0, 8, 14, $noreg :: (store 4)

    ; Make sure we move the paired stores next to each other, and
    ; insert them in an appropriate location.
    ; CHECK:      t2STRi12 {{.*}}, 0
    ; CHECK-NEXT: t2STRi12 {{.*}}, 4
    ; CHECK-NEXT: t2STRi12 {{.*}}, 8
    ; CHECK-NEXT: t2MUL
    ; CHECK-NEXT: t2MOVi32imm

    ; CHECK-LIMIT-LABEL: name: b
    ; CHECK-LIMIT:      t2STRi12 {{.*}}, 0
    ; CHECK-LIMIT-NEXT: t2STRi12 {{.*}}, 4
    ; CHECK-LIMIT-NEXT: t2MUL
    ; CHECK-LIMIT-NEXT: t2STRi12 {{.*}}, 8

    %4 : rgpr = t2MUL %1, %1, 14, $noreg
    %5 : rgpr = t2MOVi32imm -858993459
    %6 : rgpr, %7 : rgpr  = t2UMULL killed %3, %5, 14, $noreg
    %8 : rgpr, %9 : rgpr  = t2UMULL killed %4, %5, 14, $noreg
    %10 : rgpr = t2LSLri %2, 1, 14, $noreg, $noreg
    %11 : rgpr = t2MOVi 55, 14, $noreg, $noreg
    %12 : gprnopc = t2ADDrs %11, killed %7, 19, 14, $noreg, $noreg
    t2STRi12 killed %12, %0, 16, 14, $noreg :: (store 4)
    %13 : gprnopc = t2ADDrs %11, killed %9, 19, 14, $noreg, $noreg
    t2STRi12 killed %13, %0, 20, 14, $noreg :: (store 4)

    ; Make sure we move the paired stores next to each other.
    ; CHECK: t2STRi12 {{.*}}, 16
    ; CHECK-NEXT: t2STRi12 {{.*}}, 20

    tBX_RET 14, $noreg

...