77 lines · plain
1; RUN: llc < %s -mtriple=thumbv7-apple-ios -mattr=+thumb2 | FileCheck %s -check-prefix=ALL -check-prefix=CHECK2; RUN: llc < %s -mtriple=thumbv7-apple-ios -mattr=+thumb2 -arm-assume-misaligned-load-store | FileCheck %s -check-prefix=ALL -check-prefix=CONSERVATIVE3 4@X = external global [0 x i32] ; <ptr> [#uses=5]5 6define i32 @t1() "frame-pointer"="all" {7; ALL-LABEL: t1:8; ALL: push {r7, lr}9; CHECK: ldrd10; CONSERVATIVE-NOT: ldrd11; CONSERVATIVE-NOT: ldm12; ALL: pop {r7, pc}13 %tmp = load i32, ptr @X ; <i32> [#uses=1]14 %tmp3 = load i32, ptr getelementptr ([0 x i32], ptr @X, i32 0, i32 1) ; <i32> [#uses=1]15 %tmp4 = call i32 @f1( i32 %tmp, i32 %tmp3 ) ; <i32> [#uses=1]16 ret i32 %tmp417}18 19define i32 @t2() "frame-pointer"="all" {20; ALL-LABEL: t2:21; ALL: push {r7, lr}22; CHECK: ldm23; CONSERVATIVE-NOT: ldrd24; CONSERVATIVE-NOT: ldm25; ALL: pop {r7, pc}26 %tmp = load i32, ptr getelementptr ([0 x i32], ptr @X, i32 0, i32 2) ; <i32> [#uses=1]27 %tmp3 = load i32, ptr getelementptr ([0 x i32], ptr @X, i32 0, i32 3) ; <i32> [#uses=1]28 %tmp5 = load i32, ptr getelementptr ([0 x i32], ptr @X, i32 0, i32 4) ; <i32> [#uses=1]29 %tmp6 = call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; <i32> [#uses=1]30 ret i32 %tmp631}32 33define i32 @t3() "frame-pointer"="all" {34; ALL-LABEL: t3:35; ALL: push {r7, lr}36; CHECK: ldm37; CONSERVATIVE-NOT: ldrd38; CONSERVATIVE-NOT: ldm39; ALL: pop {r7, pc}40 %tmp = load i32, ptr getelementptr ([0 x i32], ptr @X, i32 0, i32 1) ; <i32> [#uses=1]41 %tmp3 = load i32, ptr getelementptr ([0 x i32], ptr @X, i32 0, i32 2) ; <i32> [#uses=1]42 %tmp5 = load i32, ptr getelementptr ([0 x i32], ptr @X, i32 0, i32 3) ; <i32> [#uses=1]43 %tmp6 = call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; <i32> [#uses=1]44 ret i32 %tmp645}46 47@g = common global ptr null48 49define void @t4(i32 %a0, i32 %a1, i32 %a2) "frame-pointer"="all" {50; ALL-LABEL: t4:51; ALL: stm.w sp, {r0, r1, r2}52; ALL: bl _ext53; ALL: ldm.w sp, {r0, r1, r2}54; ALL: bl _f255 %arr = alloca [4 x i32], align 456 %p1 = getelementptr inbounds [4 x i32], ptr %arr, i64 0, i64 157 %p2 = getelementptr inbounds [4 x i32], ptr %arr, i64 0, i64 258 store ptr %arr, ptr @g, align 859 60 store i32 %a0, ptr %arr, align 461 store i32 %a1, ptr %p1, align 462 store i32 %a2, ptr %p2, align 463 call void @ext()64 65 %v0 = load i32, ptr %arr, align 466 %v1 = load i32, ptr %p1, align 467 %v2 = load i32, ptr %p2, align 468 call i32 @f2(i32 %v0, i32 %v1, i32 %v2)69 ret void70}71 72declare i32 @f1(i32, i32)73 74declare i32 @f2(i32, i32, i32)75 76declare void @ext()77