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 aligned-section-anchors-nest-1.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer aligned-section-anchors-nest-1.s > aligned-section-anchors-nest-1.ll
6 ; ModuleID = 'aligned-section-anchors-nest-1.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 @a = internal global [32 x [32 x i32]] zeroinitializer, align 16
11 @b = internal global [32 x [32 x i32]] zeroinitializer, align 16
12 @c = internal global [32 x [32 x i32]] zeroinitializer, align 16
14 define i32* @foo() nounwind uwtable {
16 call void @clobber(i32* getelementptr inbounds ([32 x [32 x i32]]* @a, i64 0, i64 0, i64 0)) nounwind
17 call void @clobber(i32* getelementptr inbounds ([32 x [32 x i32]]* @b, i64 0, i64 0, i64 0)) nounwind
18 call void @clobber(i32* getelementptr inbounds ([32 x [32 x i32]]* @c, i64 0, i64 0, i64 0)) nounwind
21 for.cond: ; preds = %for.inc26, %entry
22 %indvar1 = phi i64 [ %indvar.next2, %for.inc26 ], [ 0, %entry ]
23 %exitcond3 = icmp ne i64 %indvar1, 32
24 br i1 %exitcond3, label %for.body, label %for.end29
26 for.body: ; preds = %for.cond
29 for.cond1: ; preds = %for.inc, %for.body
30 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %for.body ]
31 %arrayidx8 = getelementptr [32 x [32 x i32]]* @a, i64 0, i64 %indvar, i64 %indvar1
32 %arrayidx15 = getelementptr [32 x [32 x i32]]* @c, i64 0, i64 %indvar, i64 %indvar1
33 %exitcond = icmp ne i64 %indvar, 32
34 br i1 %exitcond, label %for.body4, label %for.end
36 for.body4: ; preds = %for.cond1
37 %tmp9 = load i32* %arrayidx8, align 4
38 %tmp16 = load i32* %arrayidx15, align 4
39 %add = add nsw i32 %tmp9, %tmp16
40 %tmp23 = load i32* %arrayidx15, align 4
41 %add24 = add nsw i32 %tmp23, %add
42 store i32 %add24, i32* %arrayidx15, align 4
45 for.inc: ; preds = %for.body4
46 %indvar.next = add i64 %indvar, 1
49 for.end: ; preds = %for.cond1
52 for.inc26: ; preds = %for.end
53 %indvar.next2 = add i64 %indvar1, 1
56 for.end29: ; preds = %for.cond
57 ret i32* getelementptr inbounds ([32 x [32 x i32]]* @c, i64 0, i64 0, i64 0)
60 declare void @clobber(i32*)