1 ; RUN: opt < %s -S -mtriple=powerpc64-unknown-linux-gnu -mcpu=a2 -passes=loop-unroll | FileCheck %s
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
5 ;; Check that we do emit expensive instructions to compute trip
6 ;; counts when unrolling loops on the a2 (because we unroll a lot).
8 define i32 @test(i64 %v12, ptr %array, ptr %loc) {
12 %step = load i64, ptr %loc, !range !0
15 loop: ; preds = %entry, %loop
16 %k.015 = phi i64 [ %v15, %loop ], [ %v12, %entry ]
17 %v14 = getelementptr inbounds i8, ptr %array, i64 %k.015
19 %v15 = add nuw nsw i64 %k.015, %step
20 %v16 = icmp slt i64 %v15, 8193
21 br i1 %v16, label %loop, label %loopexit
23 loopexit: ; preds = %loop
27 !0 = !{i64 1, i64 100}