1 ; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-vector -dce -S %s | FileCheck %s
2 ; Obtained from C source as:
3 ; clang -S -emit-llvm -O0 vect-121.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer vect-121.s > vect-121.ll
6 ; ModuleID = 'vect-121.s'
7 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"
8 target triple = "x86_64-unknown-linux-gnu"
10 @x = common global float* null, align 8
11 @parm = common global float 0.000000e+00, align 4
13 define float @test(i32 %start, i32 %end) nounwind uwtable {
15 %tmp = icmp sgt i32 %end, %start
16 %smax = select i1 %tmp, i32 %end, i32 %start
17 %tmp1 = sub i32 %smax, %start
18 %tmp2 = zext i32 %tmp1 to i64
19 %tmp3 = sext i32 %start to i64
22 for.cond: ; preds = %for.inc, %entry
23 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
24 %tmp4 = add i64 %tmp3, %indvar
25 %exitcond = icmp ne i64 %indvar, %tmp2
26 br i1 %exitcond, label %for.body, label %for.end
28 for.body: ; preds = %for.cond
29 %tmp5 = load float** @x, align 8
30 %arrayidx = getelementptr float* %tmp5, i64 %tmp4
31 %tmp6 = load float* %arrayidx, align 4
32 %tmp7 = load float* @parm, align 4
33 %mul = fmul float %tmp7, %tmp6
34 %arrayidx12 = getelementptr float* %tmp5, i64 %tmp4
35 store float %mul, float* %arrayidx12, align 4
38 for.inc: ; preds = %for.body
39 %indvar.next = add i64 %indvar, 1
42 for.end: ; preds = %for.cond