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 pr34591.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer pr34591.s > pr34591.ll
6 ; ModuleID = 'pr34591.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 @av_resample(i32 %filter_length, i16* %src, i16* %filter) nounwind uwtable {
12 %tmp = icmp sgt i32 %filter_length, 0
13 %smax = select i1 %tmp, i32 %filter_length, i32 0
14 %tmp1 = zext i32 %smax to i64
17 for.cond: ; preds = %for.inc, %entry
18 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
19 %val.0 = phi i32 [ 0, %entry ], [ %add, %for.inc ]
20 %arrayidx8 = getelementptr i16* %filter, i64 %indvar
21 %arrayidx = getelementptr i16* %src, i64 %indvar
22 %exitcond = icmp ne i64 %indvar, %tmp1
23 br i1 %exitcond, label %for.body, label %for.end
25 for.body: ; preds = %for.cond
28 for.inc: ; preds = %for.body
29 %tmp9 = load i16* %arrayidx8, align 2
30 %tmp4 = load i16* %arrayidx, align 2
31 %conv10 = sext i16 %tmp9 to i32
32 %conv = sext i16 %tmp4 to i32
33 %mul = mul nsw i32 %conv, %conv10
34 %add = add nsw i32 %val.0, %mul
35 %indvar.next = add i64 %indvar, 1
38 for.end: ; preds = %for.cond
39 %val.0.lcssa = phi i32 [ %val.0, %for.cond ]