1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -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: 8, alignment: 16,
13 isImmutable: true, isAliased: false }
15 - { id: 0, type: default, offset: 0, size: 8, alignment: 8 }
21 ; CHECK-LABEL: name: va_arg_i64
22 ; CHECK: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
23 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (load (p0))
24 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
25 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C]](s64)
26 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 -4
27 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p0) = G_PTRMASK [[PTR_ADD]], [[C1]](s64)
28 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
29 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[PTRMASK]], [[C2]](s64)
30 ; CHECK-NEXT: G_STORE [[PTR_ADD1]](p0), [[FRAME_INDEX]](p0) :: (store (p0))
31 ; CHECK-NEXT: PseudoRET
32 %0:_(p0) = G_FRAME_INDEX %stack.0
33 %1:_(s64) = G_VAARG %0(p0), 4
39 tracksRegLiveness: true
41 - { id: 0, type: default, offset: 0, size: 8, alignment: 16,
42 isImmutable: true, isAliased: false }
44 - { id: 0, type: default, offset: 0, size: 8, alignment: 8 }
50 ; CHECK-LABEL: name: va_arg_ptr
51 ; CHECK: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
52 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (load (p0))
53 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
54 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C]](s64)
55 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 -4
56 ; CHECK-NEXT: [[PTRMASK:%[0-9]+]]:_(p0) = G_PTRMASK [[PTR_ADD]], [[C1]](s64)
57 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
58 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[PTRMASK]], [[C2]](s64)
59 ; CHECK-NEXT: G_STORE [[PTR_ADD1]](p0), [[FRAME_INDEX]](p0) :: (store (p0))
60 ; CHECK-NEXT: PseudoRET
61 %0:_(p0) = G_FRAME_INDEX %stack.0
62 %1:_(s64) = G_VAARG %0(p0), 4