summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Mips/micromips-short-delay-slot.mir
blob: df6ca433a7d4bd853b8bc82408c450d022ac9837 (plain)
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
# RUN: llc -march=mips -mcpu=mips32r2 -mattr=+micromips %s -o - \
# RUN:     -start-after=block-placement | FileCheck %s

# Test that the micromips jal instruction is correctly handled by the delay slot
# filler by converting it to a short delay slot for the li instruction.

# CHECK-LABEL: caller13
# CHECK:      jals callee13
# CHECK-NEXT: li16

--- |
  declare i32 @callee13(i32, i32)

  define i32 @caller13() {
  entry:
    %call = tail call i32 (i32, i32) @callee13(i32 1, i32 2)
    ret i32 %call
  }

...
---
name:            caller13
alignment:       2
exposesReturnsTwice: false
legalized:       false
regBankSelected: false
selected:        false
tracksRegLiveness: true
registers:
liveins:
frameInfo:
  isFrameAddressTaken: false
  isReturnAddressTaken: false
  hasStackMap:     false
  hasPatchPoint:   false
  stackSize:       24
  offsetAdjustment: 0
  maxAlignment:    4
  adjustsStack:    true
  hasCalls:        true
  stackProtector:  ''
  maxCallFrameSize: 16
  hasOpaqueSPAdjustment: false
  hasVAStart:      false
  hasMustTailInVarArgFunc: false
  savePoint:       ''
  restorePoint:    ''
fixedStack:
stack:
  - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
      stack-id: default, callee-saved-register: '$ra', callee-saved-restored: true,
      debug-info-variable: '', debug-info-expression: '',
      debug-info-location: '' }
constants:
body:             |
  bb.0.entry:
    liveins: $ra

    $sp = ADDiu $sp, -24
    CFI_INSTRUCTION def_cfa_offset 24
    SW killed $ra, $sp, 20 :: (store 4 into %stack.0)
    CFI_INSTRUCTION offset $ra_64, -4
    $a0 = LI16_MM 1
    $a1 = LI16_MM 2
    JAL_MM @callee13, csr_o32, implicit-def dead $ra, implicit killed $a0, implicit killed $a1, implicit-def $sp, implicit-def $v0
    $ra = LW $sp, 20 :: (load 4 from %stack.0)
    $sp = ADDiu $sp, 24
    PseudoReturn undef $ra, implicit $v0


...
OpenPOWER on IntegriCloud