brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 0b48740 Raw
70 lines · plain
1; RUN: llc -mcpu=cyclone -debug-only=loop-reduce < %s 2>&1 | FileCheck %s2; REQUIRES: asserts3 4; LSR used to fail here due to a bug in the ReqRegs test.5; CHECK: The chosen solution requires6; CHECK-NOT: No Satisfactory Solution7 8target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"9target triple = "arm64-apple-ios"10 11define void @do_integer_add(i64 %iterations, ptr nocapture readonly %cookie) {12entry:13  %0 = load i32, ptr %cookie, align 414  %add = add nsw i32 %0, 5715  %cmp56 = icmp eq i64 %iterations, 016  br i1 %cmp56, label %while.end, label %for.cond.preheader.preheader17 18for.cond.preheader.preheader:                     ; preds = %entry19  br label %for.cond.preheader20 21while.cond.loopexit:                              ; preds = %for.body22  %add21.lcssa = phi i32 [ %add21, %for.body ]23  %dec58 = add i64 %dec58.in, -124  %cmp = icmp eq i64 %dec58, 025  br i1 %cmp, label %while.end.loopexit, label %for.cond.preheader26 27for.cond.preheader:                               ; preds = %for.cond.preheader.preheader, %while.cond.loopexit28  %dec58.in = phi i64 [ %dec58, %while.cond.loopexit ], [ %iterations, %for.cond.preheader.preheader ]29  %a.057 = phi i32 [ %add21.lcssa, %while.cond.loopexit ], [ %add, %for.cond.preheader.preheader ]30  br label %for.body31 32for.body:                                         ; preds = %for.body, %for.cond.preheader33  %a.154 = phi i32 [ %a.057, %for.cond.preheader ], [ %add21, %for.body ]34  %i.053 = phi i32 [ 1, %for.cond.preheader ], [ %inc, %for.body ]35  %inc = add nsw i32 %i.053, 136  %add2 = shl i32 %a.154, 137  %add3 = add nsw i32 %add2, %i.05338  %add4 = shl i32 %add3, 139  %add5 = add nsw i32 %add4, %i.05340  %add6 = shl i32 %add5, 141  %add7 = add nsw i32 %add6, %i.05342  %add8 = shl i32 %add7, 143  %add9 = add nsw i32 %add8, %i.05344  %add10 = shl i32 %add9, 145  %add11 = add nsw i32 %add10, %i.05346  %add12 = shl i32 %add11, 147  %add13 = add nsw i32 %add12, %i.05348  %add14 = shl i32 %add13, 149  %add15 = add nsw i32 %add14, %i.05350  %add16 = shl i32 %add15, 151  %add17 = add nsw i32 %add16, %i.05352  %add18 = shl i32 %add17, 153  %add19 = add nsw i32 %add18, %i.05354  %add20 = shl i32 %add19, 155  %add21 = add nsw i32 %add20, %i.05356  %exitcond = icmp eq i32 %inc, 100157  br i1 %exitcond, label %while.cond.loopexit, label %for.body58 59while.end.loopexit:                               ; preds = %while.cond.loopexit60  %add21.lcssa.lcssa = phi i32 [ %add21.lcssa, %while.cond.loopexit ]61  br label %while.end62 63while.end:                                        ; preds = %while.end.loopexit, %entry64  %a.0.lcssa = phi i32 [ %add, %entry ], [ %add21.lcssa.lcssa, %while.end.loopexit ]65  tail call void @use_int(i32 %a.0.lcssa)66  ret void67}68 69declare void @use_int(i32)70