1 ; RUN: opt %loadPolly -polly-codegen \
2 ; RUN: -polly-allow-nonaffine-branches -S -verify-dom-info \
3 ; RUN: < %s | FileCheck %s
6 ; for (int i = 0; i < 1024; i++)
7 ; if (A[i] == A[i - 1])
13 ; CHECK: polly.stmt.bb2:
14 ; CHECK: %[[offset:.*]] = shl nuw nsw i64 %polly.indvar, 2
15 ; CHECK: %scevgep[[R0:[0-9]*]] = getelementptr i8, ptr %A, i64 %[[offset]]
16 ; CHECK: %tmp3_p_scalar_ = load float, ptr %scevgep[[R0]], align 4, !alias.scope !0, !noalias !3
17 ; CHECK: %[[offset2:.*]] = shl nuw nsw i64 %polly.indvar, 2
18 ; CHECK: %scevgep[[R2:[0-9]*]] = getelementptr i8, ptr %scevgep{{[0-9]*}}, i64 %[[offset2]]
19 ; CHECK: %tmp6_p_scalar_ = load float, ptr %scevgep[[R2]], align 4, !alias.scope !0, !noalias !3
20 ; CHECK: %p_tmp7 = fcmp oeq float %tmp3_p_scalar_, %tmp6_p_scalar_
21 ; CHECK: br i1 %p_tmp7, label %polly.stmt.bb8, label %polly.stmt.bb12.[[R:[a-zA-Z_.0-9]*]]
23 ; CHECK: polly.stmt.bb8:
24 ; CHECK: %[[offset3:.*]] = shl nuw nsw i64 %polly.indvar, 2
25 ; CHECK: %scevgep[[R3:[0-9]*]] = getelementptr i8, ptr %A, i64 %[[offset3]]
26 ; CHECK: %tmp10_p_scalar_ = load float, ptr %scevgep[[R3]], align 4, !alias.scope !0, !noalias !3
27 ; CHECK: %p_tmp11 = fadd float %tmp10_p_scalar_, 1.000000e+00
28 ; CHECK: store float %p_tmp11, ptr %scevgep[[R3]], align 4, !alias.scope !0, !noalias !3
29 ; CHECK: br label %polly.stmt.bb12.[[R]]
31 ; CHECK: polly.stmt.bb12.[[R]]:
32 ; CHECK: br label %polly.stmt.bb12
34 ; CHECK: polly.stmt.bb12:
35 ; CHECK: %[[offset4:.*]] = shl nuw nsw i64 %polly.indvar, 2
36 ; CHECK: %scevgep[[R4:[0-9]*]] = getelementptr i8, ptr %A, i64 %[[offset4]]
37 ; CHECK: %tmp10b_p_scalar_ = load float, ptr %scevgep[[R4]], align 4, !alias.scope !0, !noalias !3
38 ; CHECK: %p_tmp11b = fadd float %tmp10b_p_scalar_, 1.000000e+00
39 ; CHECK: store float %p_tmp11b, ptr %scevgep[[R4]], align 4, !alias.scope !0, !noalias !3
40 ; CHECK: %polly.indvar_next = add nsw i64 %polly.indvar, 1
41 ; CHECK: %polly.loop_cond = icmp sle i64 %polly.indvar_next, 1023
42 ; CHECK: br i1 %polly.loop_cond, label %polly.loop_header, label %polly.loop_exit
44 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
46 define void @f(ptr %A) {
50 bb1: ; preds = %bb13, %bb
51 %indvars.iv = phi i64 [ %indvars.iv.next, %bb13 ], [ 0, %bb ]
52 %exitcond = icmp ne i64 %indvars.iv, 1024
53 br i1 %exitcond, label %bb2, label %bb14
56 %tmp = getelementptr inbounds float, ptr %A, i64 %indvars.iv
57 %tmp3 = load float, ptr %tmp, align 4
58 %tmp4 = add nsw i64 %indvars.iv, -1
59 %tmp5 = getelementptr inbounds float, ptr %A, i64 %tmp4
60 %tmp6 = load float, ptr %tmp5, align 4
61 %tmp7 = fcmp oeq float %tmp3, %tmp6
62 br i1 %tmp7, label %bb8, label %bb12
65 %tmp9 = getelementptr inbounds float, ptr %A, i64 %indvars.iv
66 %tmp10 = load float, ptr %tmp9, align 4
67 %tmp11 = fadd float %tmp10, 1.000000e+00
68 store float %tmp11, ptr %tmp9, align 4
71 bb12: ; preds = %bb8, %bb2
72 %tmp9b = getelementptr inbounds float, ptr %A, i64 %indvars.iv
73 %tmp10b = load float, ptr %tmp9b, align 4
74 %tmp11b = fadd float %tmp10b, 1.000000e+00
75 store float %tmp11b, ptr %tmp9b, align 4
79 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1