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 pr43432.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer pr43432.s > pr43432.ll
6 ; ModuleID = 'pr43432.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 @vector_fmul_reverse_c(float* %dst, float* %src0, float* %src1, i32 %len) nounwind uwtable {
12 %sub = add nsw i32 %len, -1
13 %tmp = icmp sgt i32 %len, 0
14 %smax = select i1 %tmp, i32 %len, i32 0
15 %tmp1 = zext i32 %smax to i64
16 %tmp3 = sext i32 %sub to i64
19 for.cond: ; preds = %for.inc, %entry
20 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
21 %arrayidx16 = getelementptr float* %dst, i64 %indvar
22 %tmp2 = mul i64 %indvar, -1
23 %tmp4 = add i64 %tmp3, %tmp2
24 %arrayidx11 = getelementptr float* %src1, i64 %tmp4
25 %arrayidx = getelementptr float* %src0, i64 %indvar
26 %exitcond = icmp ne i64 %indvar, %tmp1
27 br i1 %exitcond, label %for.body, label %for.end
29 for.body: ; preds = %for.cond
30 %tmp6 = load float* %arrayidx, align 4
31 %tmp12 = load float* %arrayidx11, align 4
32 %mul = fmul float %tmp6, %tmp12
33 store float %mul, float* %arrayidx16, align 4
36 for.inc: ; preds = %for.body
37 %indvar.next = add i64 %indvar, 1
40 for.end: ; preds = %for.cond