1; RUN: opt %loadPolly -polly-process-unprofitable=false \ 2; RUN: \ 3; RUN: -polly-detect -analyze < %s | FileCheck %s 4 5; RUN: opt %loadPolly -polly-process-unprofitable=true \ 6; RUN: \ 7; RUN: -polly-detect -analyze < %s | FileCheck %s 8 9; CHECK: Valid Region for Scop: 10 11; void foo(float *A, float *B, long N) { 12; if (N > 100) 13; for (long i = 0; i < 100; i++) 14; A[i] += i; 15; else 16; for (long i = 0; i < 100; i++) 17; B[i] += i; 18; } 19; 20target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 21 22define void @foo(float* %A, float* %B, i64 %N) { 23entry: 24 br label %bb 25 26bb: 27 %tmp = icmp sgt i64 %N, 100 28 br i1 %tmp, label %bb2, label %bb12 29 30bb2: ; preds = %bb 31 br label %bb3 32 33bb3: ; preds = %bb9, %bb2 34 %i.0 = phi i64 [ 0, %bb2 ], [ %tmp10, %bb9 ] 35 %exitcond = icmp ne i64 %i.0, 100 36 br i1 %exitcond, label %bb4, label %bb11 37 38bb4: ; preds = %bb3 39 %tmp5 = sitofp i64 %i.0 to float 40 %tmp6 = getelementptr inbounds float, float* %A, i64 %i.0 41 %tmp7 = load float, float* %tmp6, align 4 42 %tmp8 = fadd float %tmp7, %tmp5 43 store float %tmp8, float* %tmp6, align 4 44 br label %bb9 45 46bb9: ; preds = %bb4 47 %tmp10 = add nsw i64 %i.0, 1 48 br label %bb3 49 50bb11: ; preds = %bb3 51 br label %bb22 52 53bb12: ; preds = %bb 54 br label %bb13 55 56bb13: ; preds = %bb19, %bb12 57 %i1.0 = phi i64 [ 0, %bb12 ], [ %tmp20, %bb19 ] 58 %exitcond1 = icmp ne i64 %i1.0, 100 59 br i1 %exitcond1, label %bb14, label %bb21 60 61bb14: ; preds = %bb13 62 %tmp15 = sitofp i64 %i1.0 to float 63 %tmp16 = getelementptr inbounds float, float* %B, i64 %i1.0 64 %tmp17 = load float, float* %tmp16, align 4 65 %tmp18 = fadd float %tmp17, %tmp15 66 store float %tmp18, float* %tmp16, align 4 67 br label %bb19 68 69bb19: ; preds = %bb14 70 %tmp20 = add nsw i64 %i1.0, 1 71 br label %bb13 72 73bb21: ; preds = %bb13 74 br label %bb22 75 76bb22: ; preds = %bb21, %bb11 77 ret void 78} 79