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 pr36228.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer pr36228.s > pr36228.ll
6 ; ModuleID = 'pr36228.s'
8 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"
9 target triple = "x86_64-unknown-linux-gnu"
11 @t_run_test.f_1 = internal global [8 x [8 x i8]] zeroinitializer, align 16
12 @t_run_test.F_1 = internal global [8 x [8 x i64]] zeroinitializer, align 16
14 define i32 @t_run_test() nounwind uwtable {
16 %cosMatrixA = alloca [8 x [8 x i64]], align 16
19 for.cond: ; preds = %for.inc33, %entry
20 %indvar3 = phi i64 [ %indvar.next4, %for.inc33 ], [ 0, %entry ]
21 %exitcond6 = icmp ne i64 %indvar3, 8
22 br i1 %exitcond6, label %for.body, label %for.end36
24 for.body: ; preds = %for.cond
27 for.cond1: ; preds = %for.inc29, %for.body
28 %indvar1 = phi i64 [ %indvar.next2, %for.inc29 ], [ 0, %for.body ]
29 %arrayidx12 = getelementptr [8 x [8 x i8]]* @t_run_test.f_1, i64 0, i64 %indvar1, i64 %indvar3
30 %exitcond5 = icmp ne i64 %indvar1, 8
31 br i1 %exitcond5, label %for.body4, label %for.end32
33 for.body4: ; preds = %for.cond1
36 for.cond5: ; preds = %for.inc, %for.body4
37 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %for.body4 ]
38 %arrayidx19 = getelementptr [8 x [8 x i64]]* %cosMatrixA, i64 0, i64 %indvar3, i64 %indvar
39 %arrayidx26 = getelementptr [8 x [8 x i64]]* @t_run_test.F_1, i64 0, i64 %indvar1, i64 %indvar
40 %exitcond = icmp ne i64 %indvar, 8
41 br i1 %exitcond, label %for.body8, label %for.end
43 for.body8: ; preds = %for.cond5
44 %tmp13 = load i8* %arrayidx12, align 1
45 %conv = sext i8 %tmp13 to i64
46 %tmp20 = load i64* %arrayidx19, align 8
47 %mul = mul nsw i64 %conv, %tmp20
48 %tmp27 = load i64* %arrayidx26, align 8
49 %add = add nsw i64 %tmp27, %mul
50 store i64 %add, i64* %arrayidx26, align 8
53 for.inc: ; preds = %for.body8
54 %indvar.next = add i64 %indvar, 1
57 for.end: ; preds = %for.cond5
60 for.inc29: ; preds = %for.end
61 %indvar.next2 = add i64 %indvar1, 1
64 for.end32: ; preds = %for.cond1
67 for.inc33: ; preds = %for.end32
68 %indvar.next4 = add i64 %indvar3, 1
71 for.end36: ; preds = %for.cond