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 pr46663.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer pr46663.s > pr46663.ll
6 ; ModuleID = 'pr46663.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 i32 @foo(i32 ()* %bar, i32 %m) nounwind uwtable {
12 %tmp = icmp sgt i32 %m, 0
13 %smax = select i1 %tmp, i32 %m, i32 0
16 for.cond: ; preds = %for.inc, %entry
17 %tmp1 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
18 %j.0 = phi i32 [ 0, %entry ], [ %add, %for.inc ]
19 %exitcond = icmp ne i32 %tmp1, %smax
20 br i1 %exitcond, label %for.body, label %for.end
22 for.body: ; preds = %for.cond
23 %call = call i32 %bar() nounwind
26 for.inc: ; preds = %for.body
27 %add = add nsw i32 %j.0, %call
28 %inc = add nsw i32 %tmp1, 1
31 for.end: ; preds = %for.cond
32 %j.0.lcssa = phi i32 [ %j.0, %for.cond ]