[llvm-objdump] - Remove one overload of reportError. NFCI.
[llvm-complete.git] / test / CodeGen / AArch64 / GlobalISel / dynamic-alloca.ll
blobbaf0fa9aa444f75c24a3acdbf439e08f187e5603
1 ; RUN: llc -mtriple=aarch64 -global-isel %s -o - -stop-after=irtranslator | FileCheck %s
3 ; CHECK-LABEL: name: test_simple_alloca
4 ; CHECK: [[NUMELTS:%[0-9]+]]:_(s32) = COPY $w0
5 ; CHECK: [[TYPE_SIZE:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
6 ; CHECK: [[NUMELTS_64:%[0-9]+]]:_(s64) = G_ZEXT [[NUMELTS]](s32)
7 ; CHECK: [[NUMBYTES:%[0-9]+]]:_(s64) = G_MUL [[NUMELTS_64]], [[TYPE_SIZE]]
8 ; CHECK: [[SP_TMP:%[0-9]+]]:_(p0) = COPY $sp
9 ; CHECK: [[ALLOC:%[0-9]+]]:_(p0) = G_GEP [[SP_TMP]], [[NUMBYTES]]
10 ; CHECK: [[ALIGNED_ALLOC:%[0-9]+]]:_(p0) = G_PTR_MASK [[ALLOC]], 4
11 ; CHECK: $sp = COPY [[ALIGNED_ALLOC]]
12 ; CHECK: [[ALLOC:%[0-9]+]]:_(p0) = COPY [[ALIGNED_ALLOC]]
13 ; CHECK: $x0 = COPY [[ALLOC]]
14 define i8* @test_simple_alloca(i32 %numelts) {
15   %addr = alloca i8, i32 %numelts
16   ret i8* %addr
19 ; CHECK-LABEL: name: test_aligned_alloca
20 ; CHECK: [[NUMELTS:%[0-9]+]]:_(s32) = COPY $w0
21 ; CHECK: [[TYPE_SIZE:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
22 ; CHECK: [[NUMELTS_64:%[0-9]+]]:_(s64) = G_ZEXT [[NUMELTS]](s32)
23 ; CHECK: [[NUMBYTES:%[0-9]+]]:_(s64) = G_MUL [[NUMELTS_64]], [[TYPE_SIZE]]
24 ; CHECK: [[SP_TMP:%[0-9]+]]:_(p0) = COPY $sp
25 ; CHECK: [[ALLOC:%[0-9]+]]:_(p0) = G_GEP [[SP_TMP]], [[NUMBYTES]]
26 ; CHECK: [[ALIGNED_ALLOC:%[0-9]+]]:_(p0) = G_PTR_MASK [[ALLOC]], 5
27 ; CHECK: $sp = COPY [[ALIGNED_ALLOC]]
28 ; CHECK: [[ALLOC:%[0-9]+]]:_(p0) = COPY [[ALIGNED_ALLOC]]
29 ; CHECK: $x0 = COPY [[ALLOC]]
30 define i8* @test_aligned_alloca(i32 %numelts) {
31   %addr = alloca i8, i32 %numelts, align 32
32   ret i8* %addr
35 ; CHECK-LABEL: name: test_natural_alloca
36 ; CHECK: [[NUMELTS:%[0-9]+]]:_(s32) = COPY $w0
37 ; CHECK: [[TYPE_SIZE:%[0-9]+]]:_(s64) = G_CONSTANT i64 -16
38 ; CHECK: [[NUMELTS_64:%[0-9]+]]:_(s64) = G_ZEXT [[NUMELTS]](s32)
39 ; CHECK: [[NUMBYTES:%[0-9]+]]:_(s64) = G_MUL [[NUMELTS_64]], [[TYPE_SIZE]]
40 ; CHECK: [[SP_TMP:%[0-9]+]]:_(p0) = COPY $sp
41 ; CHECK: [[ALLOC:%[0-9]+]]:_(p0) = G_GEP [[SP_TMP]], [[NUMBYTES]]
42 ; CHECK: $sp = COPY [[ALLOC]]
43 ; CHECK: [[ALLOC_TMP:%[0-9]+]]:_(p0) = COPY [[ALLOC]]
44 ; CHECK: $x0 = COPY [[ALLOC_TMP]]
45 define i128* @test_natural_alloca(i32 %numelts) {
46   %addr = alloca i128, i32 %numelts
47   ret i128* %addr