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 vect-outer-4j.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer vect-outer-4j.s > vect-outer-4j.ll
6 ; ModuleID = 'vect-outer-4j.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 @in = common global [224 x i8] zeroinitializer, align 16
11 @out = common global [96 x i16] zeroinitializer, align 16
13 define void @foo() nounwind uwtable {
17 for.cond: ; preds = %for.inc18, %entry
18 %indvar1 = phi i64 [ %indvar.next2, %for.inc18 ], [ 0, %entry ]
19 %arrayidx17 = getelementptr [96 x i16]* @out, i64 0, i64 %indvar1
20 %exitcond5 = icmp ne i64 %indvar1, 96
21 br i1 %exitcond5, label %for.body, label %for.end20
23 for.body: ; preds = %for.cond
26 for.cond1: ; preds = %for.inc, %for.body
27 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %for.body ]
28 %diff.0 = phi i16 [ 0, %for.body ], [ %add10, %for.inc ]
29 %tmp6 = mul i64 %indvar, 8
30 %tmp8 = add i64 %indvar1, %tmp6
31 %arrayidx = getelementptr [224 x i8]* @in, i64 0, i64 %tmp8
32 %exitcond = icmp ne i64 %indvar, 16
33 br i1 %exitcond, label %for.body4, label %for.end
35 for.body4: ; preds = %for.cond1
38 for.inc: ; preds = %for.body4
39 %tmp7 = load i8* %arrayidx, align 1
40 %conv = zext i8 %tmp7 to i16
41 %add10 = add i16 %diff.0, %conv
42 %indvar.next = add i64 %indvar, 1
45 for.end: ; preds = %for.cond1
46 %diff.0.lcssa = phi i16 [ %diff.0, %for.cond1 ]
47 store i16 %diff.0.lcssa, i16* %arrayidx17, align 2
50 for.inc18: ; preds = %for.end
51 %indvar.next2 = add i64 %indvar1, 1
54 for.end20: ; preds = %for.cond