1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
5 define void @ptr_arg_in_regs(i32* %p) {entry: ret void}
6 define void @ptr_arg_on_stack(i32 %x1, i32 %x2, i32 %x3, i32 %x4, i32* %p) {entry: ret void}
7 define void @ret_ptr(i8* %p) {entry: ret void}
15 tracksRegLiveness: true
20 ; MIPS32-LABEL: name: ptr_arg_in_regs
21 ; MIPS32: liveins: $a0
22 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
23 ; MIPS32: [[LW:%[0-9]+]]:gpr32 = LW [[COPY]], 0 :: (load 4 from %ir.p)
24 ; MIPS32: $v0 = COPY [[LW]]
25 ; MIPS32: RetRA implicit $v0
26 %0:gprb(p0) = COPY $a0
27 %1:gprb(s32) = G_LOAD %0(p0) :: (load 4 from %ir.p)
33 name: ptr_arg_on_stack
37 tracksRegLiveness: true
39 - { id: 0, offset: 16, size: 4, alignment: 8, stack-id: default, isImmutable: true }
42 liveins: $a0, $a1, $a2, $a3
44 ; MIPS32-LABEL: name: ptr_arg_on_stack
45 ; MIPS32: liveins: $a0, $a1, $a2, $a3
46 ; MIPS32: [[ADDiu:%[0-9]+]]:gpr32 = ADDiu %fixed-stack.0, 0
47 ; MIPS32: [[LW:%[0-9]+]]:gpr32 = LW [[ADDiu]], 0 :: (load 4 from %fixed-stack.0, align 8)
48 ; MIPS32: [[LW1:%[0-9]+]]:gpr32 = LW [[LW]], 0 :: (load 4 from %ir.p)
49 ; MIPS32: $v0 = COPY [[LW1]]
50 ; MIPS32: RetRA implicit $v0
51 %0:gprb(s32) = COPY $a0
52 %1:gprb(s32) = COPY $a1
53 %2:gprb(s32) = COPY $a2
54 %3:gprb(s32) = COPY $a3
55 %5:gprb(p0) = G_FRAME_INDEX %fixed-stack.0
56 %4:gprb(p0) = G_LOAD %5(p0) :: (load 4 from %fixed-stack.0, align 8)
57 %6:gprb(s32) = G_LOAD %4(p0) :: (load 4 from %ir.p)
67 tracksRegLiveness: true
72 ; MIPS32-LABEL: name: ret_ptr
73 ; MIPS32: liveins: $a0
74 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
75 ; MIPS32: $v0 = COPY [[COPY]]
76 ; MIPS32: RetRA implicit $v0
77 %0:gprb(p0) = COPY $a0