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 pr22480.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer pr22480.s > pr22480.ll
6 ; ModuleID = 'pr22480.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 @test_1.bm = internal global [16 x i32] zeroinitializer, align 16
11 @test_2.bm = internal global [16 x i32] zeroinitializer, align 16
12 @test_3.bm = internal global [16 x i32] zeroinitializer, align 16
14 define void @test_1() nounwind uwtable {
18 for.cond: ; preds = %for.inc, %entry
19 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
20 %arrayidx = getelementptr [16 x i32]* @test_1.bm, i64 0, i64 %indvar
21 %exitcond = icmp ne i64 %indvar, 16
22 br i1 %exitcond, label %for.body, label %for.end
24 for.body: ; preds = %for.cond
25 %tmp2 = load i32* %arrayidx, align 4
26 %shl = shl i32 %tmp2, 8
27 store i32 %shl, i32* %arrayidx, align 4
30 for.inc: ; preds = %for.body
31 %indvar.next = add i64 %indvar, 1
34 for.end: ; preds = %for.cond
38 define void @test_2(i32 %a) nounwind uwtable {
42 for.cond: ; preds = %for.inc, %entry
43 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
44 %arrayidx = getelementptr [16 x i32]* @test_2.bm, i64 0, i64 %indvar
45 %exitcond = icmp ne i64 %indvar, 16
46 br i1 %exitcond, label %for.body, label %for.end
48 for.body: ; preds = %for.cond
49 %tmp3 = load i32* %arrayidx, align 4
50 %shl = shl i32 %tmp3, %a
51 store i32 %shl, i32* %arrayidx, align 4
54 for.inc: ; preds = %for.body
55 %indvar.next = add i64 %indvar, 1
58 for.end: ; preds = %for.cond
62 define void @test_3() nounwind uwtable {
64 %am = alloca [16 x i32], align 16
67 for.cond: ; preds = %for.inc, %entry
68 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %entry ]
69 %arrayidx5 = getelementptr [16 x i32]* @test_3.bm, i64 0, i64 %indvar
70 %arrayidx = getelementptr [16 x i32]* %am, i64 0, i64 %indvar
71 %exitcond = icmp ne i64 %indvar, 16
72 br i1 %exitcond, label %for.body, label %for.end
74 for.body: ; preds = %for.cond
75 %tmp2 = load i32* %arrayidx, align 4
76 %tmp6 = load i32* %arrayidx5, align 4
77 %shl = shl i32 %tmp6, %tmp2
78 store i32 %shl, i32* %arrayidx5, align 4
81 for.inc: ; preds = %for.body
82 %indvar.next = add i64 %indvar, 1
85 for.end: ; preds = %for.cond