brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 90ecd38 Raw
47 lines · plain
1; RUN: llc < %s | FileCheck %s2target triple = "thumbv6---gnueabi"3 4; Use STM to save the three registers5; CHECK-LABEL: use_stm:6; CHECK: .save   {r7, lr}7; CHECK: .setfp  r7, sp8; CHECK: stm r3!, {r0, r1, r2}9; CHECK: bl throws_110define void @use_stm(i32 %a, i32 %b, i32 %c, ptr %d) local_unnamed_addr noreturn "frame-pointer"="all" {11entry:12  %arrayidx = getelementptr inbounds i32, ptr %d, i32 213  store i32 %a, ptr %arrayidx, align 414  %arrayidx1 = getelementptr inbounds i32, ptr %d, i32 315  store i32 %b, ptr %arrayidx1, align 416  %arrayidx2 = getelementptr inbounds i32, ptr %d, i32 417  store i32 %c, ptr %arrayidx2, align 418  tail call void @throws_1(i32 %a, i32 %b, i32 %c) noreturn19  unreachable20}21 22; Don't use STM: there is no available register to store23; the address. We could transform this with some extra math, but24; that currently isn't implemented.25; CHECK-LABEL: no_stm:26; CHECK: .save   {r7, lr}27; CHECK: .setfp  r7, sp28; CHECK: str r0,29; CHECK: str r1,30; CHECK: str r2,31; CHECK: bl throws_232define void @no_stm(i32 %a, i32 %b, i32 %c, ptr %d) local_unnamed_addr noreturn "frame-pointer"="all" {33entry:34  %arrayidx = getelementptr inbounds i32, ptr %d, i32 235  store i32 %a, ptr %arrayidx, align 436  %arrayidx1 = getelementptr inbounds i32, ptr %d, i32 337  store i32 %b, ptr %arrayidx1, align 438  %arrayidx2 = getelementptr inbounds i32, ptr %d, i32 439  store i32 %c, ptr %arrayidx2, align 440  tail call void @throws_2(i32 %a, i32 %b, i32 %c, ptr %d) noreturn41  unreachable42}43 44 45declare void @throws_1(i32, i32, i32) noreturn46declare void @throws_2(i32, i32, i32, ptr) noreturn47