1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - | FileCheck %s
4 # On RISC-V, the MinStackArgumentAlignment is 1 and the ABI Alignment for p0 is
5 # greater than 1, so we will always generate code to adjust for this alignment.
10 tracksRegLiveness: true
12 - { id: 0, type: default, offset: 0, size: 4, alignment: 16,
13 isImmutable: true, isAliased: false }
15 - { id: 0, type: default, offset: 0, size: 4, alignment: 4 }
21 liveins: $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17
22 ; CHECK-LABEL: name: va_arg_i32
23 ; CHECK: liveins: $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17
25 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
26 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (load (p0))
27 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
28 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C]](s32)
29 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -4
30 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p0) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
31 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
32 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[PTRMASK]], [[C2]](s32)
33 ; CHECK-NEXT: G_STORE [[PTR_ADD1]](p0), [[FRAME_INDEX]](p0) :: (store (p0))
34 ; CHECK-NEXT: PseudoRET
35 %0:_(p0) = G_FRAME_INDEX %stack.0
36 %1:_(s32) = G_VAARG %0(p0), 4
42 tracksRegLiveness: true
44 - { id: 0, type: default, offset: 0, size: 4, alignment: 16,
45 isImmutable: true, isAliased: false }
47 - { id: 0, type: default, offset: 0, size: 4, alignment: 4 }
53 liveins: $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17
54 ; CHECK-LABEL: name: va_arg_ptr
55 ; CHECK: liveins: $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17
57 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
58 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (load (p0))
59 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
60 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C]](s32)
61 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -4
62 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p0) = G_PTRMASK [[PTR_ADD]], [[C1]](s32)
63 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
64 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[PTRMASK]], [[C2]](s32)
65 ; CHECK-NEXT: G_STORE [[PTR_ADD1]](p0), [[FRAME_INDEX]](p0) :: (store (p0))
66 ; CHECK-NEXT: PseudoRET
67 %0:_(p0) = G_FRAME_INDEX %stack.0
68 %1:_(p0) = G_VAARG %0(p0), 4