73 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -polly-detect-keep-going -polly-allow-nonaffine -disable-output < %s | FileCheck %s2;3; The instruction4;5; %idxprom = sext i32 %call to i646;7; uses an argument that is inside and error block. Since error blocks are8; removed from the SCoP, the argument is not available. Polly currently9; does not consider that %idxprom itself is an error block as well.10;11; This also tests that -polly-detect-keep-going still correctly rejects this SCoP.12; https://llvm.org/PR5848413;14; CHECK: Printing analysis 'Polly - Create polyhedral description of Scops' for region: 'for.cond => for.end' in function 'g':15; CHECK-NEXT: Invalid Scop!16;17; int f();18; void g(int *A, int N) {19; for (int i = 0; i < N; i++) {20; if (i > 512) {21; int v = f();22; S:23; A[v]++;24; }25; A[i]++;26; }27; }28;29target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"30 31define void @g(ptr %A, i32 %N) {32entry:33 %tmp = sext i32 %N to i6434 br label %for.cond35 36for.cond: ; preds = %for.inc, %entry37 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]38 %cmp = icmp slt i64 %indvars.iv, %tmp39 br i1 %cmp, label %for.body, label %for.end40 41for.body: ; preds = %for.cond42 %cmp1 = icmp sgt i64 %indvars.iv, 51243 br i1 %cmp1, label %if.then, label %if.end344 45if.then: ; preds = %for.body46 %call = call i32 (...) @f()47 br label %S48 49S: ; preds = %if.then50 %idxprom = sext i32 %call to i6451 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom52 %tmp1 = load i32, ptr %arrayidx, align 453 %inc = add nsw i32 %tmp1, 154 store i32 %inc, ptr %arrayidx, align 455 br label %if.end356 57if.end3: ; preds = %if.end, %for.body58 %arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv59 %tmp2 = load i32, ptr %arrayidx5, align 460 %inc6 = add nsw i32 %tmp2, 161 store i32 %inc6, ptr %arrayidx5, align 462 br label %for.inc63 64for.inc: ; preds = %if.end3, %if.then265 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 166 br label %for.cond67 68for.end: ; preds = %for.cond69 ret void70}71 72declare i32 @f(...)73