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 pr45633.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer pr45633.s > pr45633.ll
6 ; ModuleID = 'pr45633.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 @s = common global [32 x i32] zeroinitializer, align 16
11 @t = common global [32 x i8*] zeroinitializer, align 16
13 define void @foo() nounwind uwtable {
17 for.cond: ; preds = %for.inc, %entry
18 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
19 %arrayidx5 = getelementptr [32 x i8*]* @t, i64 0, i64 %indvar
20 %arrayidx = getelementptr [32 x i32]* @s, i64 0, i64 %indvar
21 %exitcond = icmp ne i64 %indvar, 32
22 br i1 %exitcond, label %for.body, label %for.end
24 for.body: ; preds = %for.cond
25 %tmp2 = load i32* %arrayidx, align 4
26 %tmp6 = load i8** %arrayidx5, align 8
27 %idx.ext = sext i32 %tmp2 to i64
28 %idx.neg = sub i64 0, %idx.ext
29 %add.ptr = getelementptr inbounds i8* %tmp6, i64 %idx.neg
30 store i8* %add.ptr, i8** %arrayidx5, align 8
33 for.inc: ; preds = %for.body
34 %indvar.next = add i64 %indvar, 1
37 for.end: ; preds = %for.cond