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 pr49318.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer pr49318.s > pr49318.ll
6 ; ModuleID = 'pr49318.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 %struct.gl_context = type { [16 x float], i32 }
12 define void @gl_GetDoublev(%struct.gl_context* %ctx, i32 %pname, double* %params) nounwind uwtable {
16 for.cond: ; preds = %for.inc, %entry
17 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
18 %arrayidx8 = getelementptr double* %params, i64 %indvar
19 %arrayidx = getelementptr %struct.gl_context* %ctx, i64 0, i32 0, i64 %indvar
20 %exitcond = icmp ne i64 %indvar, 16
21 br i1 %exitcond, label %for.body, label %for.end
23 for.body: ; preds = %for.cond
24 %tmp3 = load float* %arrayidx, align 4
25 %conv = fptosi float %tmp3 to i32
26 %conv4 = sitofp i32 %conv to double
27 store double %conv4, double* %arrayidx8, align 8
30 for.inc: ; preds = %for.body
31 %indvar.next = add i64 %indvar, 1
34 for.end: ; preds = %for.cond