Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Isl / CodeGen / blas_sscal_simplified.ll
blob0ba55dfe5a32fc3c1f572333a041505c0b81bdca
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-codegen-isl < %s
3 ; Regression test for a bug in the runtime check generation.
5 ; This was extracted from the blas testcase. It crashed in one
6 ; part of the runtime check generation at some point. To be
7 ; precise, we couldn't find a suitable block to put the RTC code in.
9 ; int sscal(int n, float sa, float *sx) {
10 ;   for(int i=0; i<n; i++, sx++)
11 ;     *sx *= sa;
12 ;   return 0;
13 ; }
15 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
17 define i32 @sscal(i32 %n, float %sa, float* %sx) {
18 entry:
19   br label %entry.split
21 entry.split:                                      ; preds = %entry
22   %cmp1 = icmp sgt i32 %n, 0
23   br i1 %cmp1, label %for.body.lr.ph, label %for.end
25 for.body.lr.ph:                                   ; preds = %entry.split
26   %0 = zext i32 %n to i64
27   br label %for.body
29 for.body:                                         ; preds = %for.body.lr.ph, %for.body
30   %indvar = phi i64 [ 0, %for.body.lr.ph ], [ %indvar.next, %for.body ]
31   %sx.addr.02 = getelementptr float, float* %sx, i64 %indvar
32   %tmp = load float* %sx.addr.02, align 4
33   %mul = fmul float %tmp, %sa
34   store float %mul, float* %sx.addr.02, align 4
35   %indvar.next = add i64 %indvar, 1
36   %exitcond = icmp ne i64 %indvar.next, %0
37   br i1 %exitcond, label %for.body, label %for.cond.for.end_crit_edge
39 for.cond.for.end_crit_edge:                       ; preds = %for.body
40   br label %for.end
42 for.end:                                          ; preds = %for.cond.for.end_crit_edge, %entry.split
43   ret i32 0