89 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<delicm>' -polly-print-delicm -disable-output < %s | FileCheck %s2;3; void func(double *A) {4; for (int j = 0; j < 2; j += 1) { /* outer */5; double phi = 0.0;6; for (int i = 0; i < 4; i += 1) /* reduction */7; if (phi < 0.0)8; A[j] = undef;9; phi += 4.2;10; A[j] = phi;11; }12; }13;14; The MAY_WRITE in reduction.for.true conflict with a write of %phi to15; A[j] if %phi would be mapped to it. Being a MAY_WRITE avoids being target16; of a mapping itself.17;18; TODO: There is actually no reason why these conflict. The MAY_WRITE is an19; explicit write, defined to occur always before all implicit writes as the20; write of %phi would be. There is currently no differentiation between21; implicit and explicit writes in Polly.22;23define void @func(ptr noalias nonnull %A) {24entry:25 %fsomeval = fadd double 21.0, 21.026 br label %outer.preheader27 28outer.preheader:29 br label %outer.for30 31outer.for:32 %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]33 %j.cmp = icmp slt i32 %j, 234 br i1 %j.cmp, label %reduction.preheader, label %outer.exit35 36 37 reduction.preheader:38 br label %reduction.for39 40 reduction.for:41 %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]42 %phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]43 %A_idx = getelementptr inbounds double, ptr %A, i32 %j44 %phi.cmp = fcmp ogt double %phi, 0.045 br i1 %phi.cmp, label %reduction.for.true, label %reduction.for.unconditional46 47 reduction.for.true:48 store double undef, ptr %A_idx49 br label %reduction.for.unconditional50 51 reduction.for.unconditional:52 %i.cmp = icmp slt i32 %i, 453 br i1 %i.cmp, label %body, label %reduction.exit54 55 56 57 body:58 %add = fadd double %phi, 4.259 br label %reduction.inc60 61 62 63 reduction.inc:64 %i.inc = add nuw nsw i32 %i, 165 br label %reduction.for66 67 reduction.exit:68 store double %phi, ptr %A_idx69 br label %outer.inc70 71 72 73outer.inc:74 %j.inc = add nuw nsw i32 %j, 175 br label %outer.for76 77outer.exit:78 br label %return79 80return:81 ret void82}83 84 85; CHECK: Statistics {86; CHECK: Compatible overwrites: 187; CHECK: }88; CHECK: No modification has been made89