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 no-trapping-math-1.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer no-trapping-math-1.s > no-trapping-math-1.ll
6 ; ModuleID = 'no-trapping-math-1.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 define void @foo(float* %a, [32 x float]* %b) nounwind uwtable {
14 for.cond: ; preds = %for.inc, %entry
15 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
16 %tmp = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
17 %arrayidx9 = getelementptr [32 x float]* %b, i64 1, i64 %indvar
18 %arrayidx27 = getelementptr float* %a, i64 %indvar
19 %arrayidx3 = getelementptr [32 x float]* %b, i64 0, i64 %indvar
20 %exitcond = icmp ne i64 %indvar, 32
21 br i1 %exitcond, label %for.body, label %for.end
23 for.body: ; preds = %for.cond
24 %tmp4 = load float* %arrayidx3, align 4
25 %tmp10 = load float* %arrayidx9, align 4
26 %cmp11 = fcmp ogt float %tmp4, %tmp10
27 br i1 %cmp11, label %cond.true, label %cond.false
29 cond.true: ; preds = %for.body
30 %idxprom13 = sext i32 %tmp to i64
31 %arrayidx16 = getelementptr inbounds [32 x float]* %b, i64 0, i64 %idxprom13
34 cond.false: ; preds = %for.body
37 cond.end: ; preds = %cond.false, %cond.true
38 %cond.in = phi float* [ %arrayidx16, %cond.true ], [ %arrayidx9, %cond.false ]
39 %cond = load float* %cond.in, align 4
40 store float %cond, float* %arrayidx27, align 4
43 for.inc: ; preds = %cond.end
44 %inc = add nsw i32 %tmp, 1
45 %indvar.next = add i64 %indvar, 1
48 for.end: ; preds = %for.cond