1 ; RUN: llc < %s | FileCheck %s
3 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
4 target triple = "thumbv5e-none-linux-gnueabi"
6 ; Function Attrs: norecurse nounwind optsize
7 define void @f(i32,i32,i32,i32,ptr %x4p, ptr %x5p, ptr %x6p) {
12 %ll.0100 = phi i64 [ 0, %if.end ], [ %shr32, %while.body ]
13 %add = add nuw nsw i64 %ll.0100, 0
14 %add3 = add nuw nsw i64 %add, 0
15 %shr = lshr i64 %add3, 32
16 %conv7 = zext i32 %0 to i64
17 %conv9 = zext i32 %1 to i64
18 %add10 = add nuw nsw i64 %conv9, %conv7
19 %add11 = add nuw nsw i64 %add10, %shr
20 %shr14 = lshr i64 %add11, 32
21 %conv16 = zext i32 %2 to i64
22 %conv18 = zext i32 %3 to i64
23 %add19 = add nuw nsw i64 %conv18, %conv16
24 %add20 = add nuw nsw i64 %add19, %shr14
25 %conv21 = trunc i64 %add20 to i32
26 store i32 %conv21, ptr %x6p, align 4
27 %shr23 = lshr i64 %add20, 32
28 %x4 = load i32, ptr %x4p, align 4
29 %conv25 = zext i32 %x4 to i64
30 %x5 = load i32, ptr %x5p, align 4
31 %conv27 = zext i32 %x5 to i64
32 %add28 = add nuw nsw i64 %conv27, %conv25
33 %add29 = add nuw nsw i64 %add28, %shr23
34 %shr32 = lshr i64 %add29, 32
37 ; CHECK: adds r3, r0, r1
41 ; CHECK: ldr r0, [sp, #12] @ 4-byte Reload
42 ; CHECK: ldr r2, [sp, #8] @ 4-byte Reload
43 ; CHECK: adds r2, r0, r2
47 ; CHECK: adds r0, r2, r5
51 ; CHECK: ldr r6, [sp, #4] @ 4-byte Reload
54 ; CHECK: ldr r6, [sp] @ 4-byte Reload
56 ; CHECK: adds r0, r6, r0