AArch64/ARM64: move ARM64 into AArch64's place
[oota-llvm.git] / test / Transforms / LoopStrengthReduce / AArch64 / req-regs.ll
1 ; RUN: llc -mcpu=cyclone -debug-only=loop-reduce < %s 2>&1 | FileCheck %s
2 ; REQUIRES: asserts
3
4 ; LSR used to fail here due to a bug in the ReqRegs test.
5 ; CHECK: The chosen solution requires
6 ; CHECK-NOT: No Satisfactory Solution
7
8 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
9 target triple = "arm64-apple-ios"
10
11 define void @do_integer_add(i64 %iterations, i8* nocapture readonly %cookie) {
12 entry:
13   %N = bitcast i8* %cookie to i32*
14   %0 = load i32* %N, align 4
15   %add = add nsw i32 %0, 57
16   %cmp56 = icmp eq i64 %iterations, 0
17   br i1 %cmp56, label %while.end, label %for.cond.preheader.preheader
18
19 for.cond.preheader.preheader:                     ; preds = %entry
20   br label %for.cond.preheader
21
22 while.cond.loopexit:                              ; preds = %for.body
23   %add21.lcssa = phi i32 [ %add21, %for.body ]
24   %dec58 = add i64 %dec58.in, -1
25   %cmp = icmp eq i64 %dec58, 0
26   br i1 %cmp, label %while.end.loopexit, label %for.cond.preheader
27
28 for.cond.preheader:                               ; preds = %for.cond.preheader.preheader, %while.cond.loopexit
29   %dec58.in = phi i64 [ %dec58, %while.cond.loopexit ], [ %iterations, %for.cond.preheader.preheader ]
30   %a.057 = phi i32 [ %add21.lcssa, %while.cond.loopexit ], [ %add, %for.cond.preheader.preheader ]
31   br label %for.body
32
33 for.body:                                         ; preds = %for.body, %for.cond.preheader
34   %a.154 = phi i32 [ %a.057, %for.cond.preheader ], [ %add21, %for.body ]
35   %i.053 = phi i32 [ 1, %for.cond.preheader ], [ %inc, %for.body ]
36   %inc = add nsw i32 %i.053, 1
37   %add2 = shl i32 %a.154, 1
38   %add3 = add nsw i32 %add2, %i.053
39   %add4 = shl i32 %add3, 1
40   %add5 = add nsw i32 %add4, %i.053
41   %add6 = shl i32 %add5, 1
42   %add7 = add nsw i32 %add6, %i.053
43   %add8 = shl i32 %add7, 1
44   %add9 = add nsw i32 %add8, %i.053
45   %add10 = shl i32 %add9, 1
46   %add11 = add nsw i32 %add10, %i.053
47   %add12 = shl i32 %add11, 1
48   %add13 = add nsw i32 %add12, %i.053
49   %add14 = shl i32 %add13, 1
50   %add15 = add nsw i32 %add14, %i.053
51   %add16 = shl i32 %add15, 1
52   %add17 = add nsw i32 %add16, %i.053
53   %add18 = shl i32 %add17, 1
54   %add19 = add nsw i32 %add18, %i.053
55   %add20 = shl i32 %add19, 1
56   %add21 = add nsw i32 %add20, %i.053
57   %exitcond = icmp eq i32 %inc, 1001
58   br i1 %exitcond, label %while.cond.loopexit, label %for.body
59
60 while.end.loopexit:                               ; preds = %while.cond.loopexit
61   %add21.lcssa.lcssa = phi i32 [ %add21.lcssa, %while.cond.loopexit ]
62   br label %while.end
63
64 while.end:                                        ; preds = %while.end.loopexit, %entry
65   %a.0.lcssa = phi i32 [ %add, %entry ], [ %add21.lcssa.lcssa, %while.end.loopexit ]
66   tail call void @use_int(i32 %a.0.lcssa)
67   ret void
68 }
69
70 declare void @use_int(i32)