1; RUN: opt %loadPolly -analyze -polly-scops < %s | FileCheck %s -check-prefix=SCOP 2 3; There is no FileCheck because we want to make sure that this doesn't crash. 4; RUN: opt %loadPolly -polly-codegen-ppcg -polly-acc-fail-on-verify-module-failure \ 5; RUN: -disable-output < %s 6 7; REQUIRES: pollyacc 8 9; Due to the existence of the `fence` call, We can only detect the inner loop 10; and not the outer loop. PPCGCodeGeneration had not implemented this case. 11; The fix was to pull the implementation from `IslNodeBuilder. 12 13; Make sure that we only capture the inner loop 14; SCOP: Function: f 15; SCOP-NEXT: Region: %for2.body---%for2.body.fence 16; SCOP-NEXT: Max Loop Depth: 1 17 18target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" 19target triple = "x86_64-unknown-linux-gnu" 20 21declare void @fn_to_fence(i32 *%val) 22 23; void f(int *arr, bool shouldcont) { 24; for(int i = 0; ; i++) { 25; for(int j = 0; j < 10; j++) { 26; arr[j] = i; 27; } 28; fence(arr); 29; if (!shouldcont) break; 30; } 31; } 32 33 34; Function Attrs: nounwind uwtable 35define void @f(i32 *%arr, i1 %shouldcont) #1 { 36entry: 37 br label %for.init 38 39for.init: ; preds = %for.end, %entry.split 40 %i = phi i32 [ %i.next, %for.end ], [ 0, %entry ] 41 br label %for2.body 42 43for2.body: ; preds = %"65", %"64" 44 %j = phi i32 [ %j.next, %for2.body ], [ 0, %for.init ] 45 %j.sext = sext i32 %j to i64 46 %arr.slot = getelementptr i32, i32* %arr, i64 %j.sext 47 store i32 %i, i32* %arr.slot, align 4 48 %exitcond = icmp eq i32 %j, 10 49 %j.next = add i32 %j, 1 50 br i1 %exitcond, label %for2.body.fence, label %for2.body 51 52for2.body.fence: ; preds = %"65" 53 call void @fn_to_fence(i32* %arr) #2 54 br i1 %shouldcont, label %for.end, label %exit 55for.end: ; preds = %"69" 56 %i.next = add i32 %i, 1 57 br label %for.init 58 59exit: ; preds = %"69" 60 ret void 61 62} 63 64 65attributes #0 = { argmemonly nounwind } 66attributes #1 = { nounwind uwtable } 67attributes #2 = { nounwind } 68