59 lines · plain
1; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb '-passes=polly-custom<import-jscop;codegen>' -polly-import-jscop-postfix=transformed -S < %s | FileCheck %s2;3; The isl scheduler isolates %cond.false into two instances.4; A partial write access in one of the instances was never executed,5; which caused problems when querying for its index expression, which6; is not available in that case.7;8target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"9 10define void @partial_write_impossible_restriction(ptr %.pn) {11entry:12 br i1 undef, label %invoke.cont258, label %cond.true.i.i.i.i100713 14cond.true.i.i.i.i1007:15 br label %invoke.cont25816 17invoke.cont258:18 br label %invoke.cont27419 20invoke.cont274: ; preds = %invoke.cont25821 %tmp4 = load ptr, ptr undef22 %tmp5 = load i32, ptr undef23 %tmp6 = zext i32 %tmp5 to i6424 %tmp7 = sext i32 %tmp5 to i6425 br label %for.body34426 27for.body344: ; preds = %cond.end, %invoke.cont27428 %indvars.iv1602 = phi i64 [ 0, %invoke.cont274 ], [ %indvars.iv.next1603, %cond.end ]29 %indvars.iv.next1603 = add nuw nsw i64 %indvars.iv1602, 130 %cmp347 = icmp eq i64 %indvars.iv.next1603, %tmp631 br i1 %cmp347, label %cond.end, label %cond.false32 33cond.false: ; preds = %for.body34434 %add.ptr.i1128 = getelementptr inbounds i32, ptr %tmp4, i64 %indvars.iv.next160335 %cond.in.sroa.speculate.load.cond.false = load i32, ptr %add.ptr.i112836 br label %cond.end37 38cond.end: ; preds = %cond.false, %for.body34439 %cond.in.sroa.speculated = phi i32 [ %cond.in.sroa.speculate.load.cond.false, %cond.false ], [ undef, %for.body344 ]40 %add.ptr.i1132 = getelementptr inbounds i32, ptr %.pn, i64 %indvars.iv160241 store i32 undef, ptr %add.ptr.i113242 %cmp342 = icmp slt i64 %indvars.iv.next1603, %tmp743 br i1 %cmp342, label %for.body344, label %if.then.i.i1141.loopexit44 45if.then.i.i1141.loopexit: ; preds = %cond.end46 ret void47}48 49 50; CHECK-LABEL: polly.stmt.cond.false:51; CHECK: %polly.access..pn{{[0-9]*}} = getelementptr i32, ptr %.pn, i64 %polly.indvar52; CHECK: store i32 %cond.in.sroa.speculate.load.cond.false_p_scalar_, ptr %polly.access..pn{{[0-9]*}}, align 4, !alias.scope !2, !noalias !553; CHECK: br label %polly.merge54 55; CHECK-LABEL: polly.stmt.cond.false{{[0-9]*}}:56; CHECK: %polly.access..pn{{[0-9]*}} = getelementptr i32, ptr %.pn, i64 057; CHECK: store i32 %cond.in.sroa.speculate.load.cond.false_p_scalar_{{[0-9]*}}, ptr %polly.access..pn{{[0-9]*}}, align 4, !alias.scope !2, !noalias !558; CHECK: br label %polly.stmt.cond.end{{[0-9]*}}59