OSDN Git Service

[MIPS GlobalISel] Select global address
[android-x86/external-llvm.git] / test / CodeGen / Mips / micromips-short-delay-slot.mir
1 # RUN: llc -march=mips -mcpu=mips32r2 -mattr=+micromips %s -o - \
2 # RUN:     -start-after=block-placement | FileCheck %s
3
4 # Test that the micromips jal instruction is correctly handled by the delay slot
5 # filler by converting it to a short delay slot for the li instruction.
6
7 # CHECK-LABEL: caller13
8 # CHECK:      jals callee13
9 # CHECK-NEXT: li16
10
11 --- |
12   declare i32 @callee13(i32, i32)
13
14   define i32 @caller13() {
15   entry:
16     %call = tail call i32 (i32, i32) @callee13(i32 1, i32 2)
17     ret i32 %call
18   }
19
20 ...
21 ---
22 name:            caller13
23 alignment:       2
24 exposesReturnsTwice: false
25 legalized:       false
26 regBankSelected: false
27 selected:        false
28 tracksRegLiveness: true
29 registers:
30 liveins:
31 frameInfo:
32   isFrameAddressTaken: false
33   isReturnAddressTaken: false
34   hasStackMap:     false
35   hasPatchPoint:   false
36   stackSize:       24
37   offsetAdjustment: 0
38   maxAlignment:    4
39   adjustsStack:    true
40   hasCalls:        true
41   stackProtector:  ''
42   maxCallFrameSize: 16
43   hasOpaqueSPAdjustment: false
44   hasVAStart:      false
45   hasMustTailInVarArgFunc: false
46   savePoint:       ''
47   restorePoint:    ''
48 fixedStack:
49 stack:
50   - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
51       stack-id: 0, callee-saved-register: '$ra', callee-saved-restored: true,
52       debug-info-variable: '', debug-info-expression: '',
53       debug-info-location: '' }
54 constants:
55 body:             |
56   bb.0.entry:
57     liveins: $ra
58
59     $sp = ADDiu $sp, -24
60     CFI_INSTRUCTION def_cfa_offset 24
61     SW killed $ra, $sp, 20 :: (store 4 into %stack.0)
62     CFI_INSTRUCTION offset $ra_64, -4
63     $a0 = LI16_MM 1
64     $a1 = LI16_MM 2
65     JAL_MM @callee13, csr_o32, implicit-def dead $ra, implicit killed $a0, implicit killed $a1, implicit-def $sp, implicit-def $v0
66     $ra = LW $sp, 20 :: (load 4 from %stack.0)
67     $sp = ADDiu $sp, 24
68     PseudoReturn undef $ra, implicit $v0
69
70
71 ...