brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 9e49300 Raw
80 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 phi1 = 0.0, phi2 = 0.0;6;        for (int i = 0; i < 4; i += 1) { /* reduction */7;          phi1 += 4.2;8;          phi2 += 29.0;9;        }10;        A[j] = phi1 + phi2;11;      }12;    }13;14; Check that we cannot map both, %phi1 and %phi2 to A[j] (conflict).15; Note that it is undefined which one will be mapped. We keep the test16; symmetric so it passes if either one is mapped.17;18define void @func(ptr noalias nonnull %A) {19entry:20  br label %outer.preheader21 22outer.preheader:23  br label %outer.for24 25outer.for:26  %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]27  %j.cmp = icmp slt i32 %j, 228  br i1 %j.cmp, label %reduction.preheader, label %outer.exit29 30 31    reduction.preheader:32      br label %reduction.for33 34    reduction.for:35      %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]36      %phi1 = phi double [0.0, %reduction.preheader], [%add1, %reduction.inc]37      %phi2 = phi double [0.0, %reduction.preheader], [%add2, %reduction.inc]38      %i.cmp = icmp slt i32 %i, 439      br i1 %i.cmp, label %body, label %reduction.exit40 41 42 43        body:44          %add1 = fadd double %phi1, 4.245          %add2 = fadd double %phi2, 29.046          br label %reduction.inc47 48 49 50    reduction.inc:51      %i.inc = add nuw nsw i32 %i, 152      br label %reduction.for53 54    reduction.exit:55      %A_idx = getelementptr inbounds double, ptr %A, i32 %j56      %sum = fadd double %phi1, %phi257      store double %sum, ptr %A_idx58      br label %outer.inc59 60 61 62outer.inc:63  %j.inc = add nuw nsw i32 %j, 164  br label %outer.for65 66outer.exit:67  br label %return68 69return:70  ret void71}72 73 74; CHECK: Statistics {75; CHECK:     Compatible overwrites: 176; CHECK:     Overwrites mapped to:  177; CHECK:     Value scalars mapped:  278; CHECK:     PHI scalars mapped:    179; CHECK: }80