brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 67bac06 Raw
74 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<delicm>' -polly-print-delicm -disable-output < %s | FileCheck %s2;3;    void func(double *A) {4;      fsomeval = 21.0 + 21.0;5;      for (int j = 0; j < 2; j += 1) { /* outer */6;        double phi = 0.0;7;        for (int i = 0; i < 4; i += 1) /* reduction */8;          phi += 4.2;9;        A[j] = fsomeval;10;      }11;    }12;13; Check that fsomeval is not mapped to A[j] because it is read-only.14; There is no advantage in mapping values not modified within the SCoP.15;16define void @func(ptr noalias nonnull %A) {17entry:18  %fsomeval = fadd double 21.0, 21.019  br label %outer.preheader20 21outer.preheader:22  br label %outer.for23 24outer.for:25  %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]26  %j.cmp = icmp slt i32 %j, 227  br i1 %j.cmp, label %reduction.preheader, label %outer.exit28 29 30    reduction.preheader:31      br label %reduction.for32 33    reduction.for:34      %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]35      %phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]36      %i.cmp = icmp slt i32 %i, 437      br i1 %i.cmp, label %body, label %reduction.exit38 39 40 41        body:42          %add = fadd double %phi, 4.243          br label %reduction.inc44 45 46 47    reduction.inc:48      %i.inc = add nuw nsw i32 %i, 149      br label %reduction.for50 51    reduction.exit:52      %A_idx = getelementptr inbounds double, ptr %A, i32 %j53      store double %fsomeval, ptr %A_idx54      br label %outer.inc55 56 57 58outer.inc:59  %j.inc = add nuw nsw i32 %j, 160  br label %outer.for61 62outer.exit:63  br label %return64 65return:66  ret void67}68 69 70; CHECK: Statistics {71; CHECK:     Compatible overwrites: 172; CHECK: }73; CHECK: No modification has been made74