brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · a213a91 Raw
71 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<delicm>' -pass-remarks-missed=polly-delicm -disable-output < %s 2>&1 | FileCheck %s2;3; llvm.org/PR344854; llvm.org/PR349895;6; The memset causes the array A to be divided into i8-sized subelements.7; The the regular store then writes multiple of these subelements, which8; we do not support currently.9;10;    void func(double *A) {11;      memset(A, 0, 4);12;      for (int j = 0; j < 2; j += 1) { /* outer */13;        double phi = 0.0;14;        for (int i = 0; i < 4; i += 1) /* reduction */15;          phi += 4.2;16;        A[j] = phi;17;      }18;    }19 20declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i32, i1)21 22define void @func(ptr noalias nonnull %A) {23entry:24  br label %outer.for25 26outer.for:27  %j = phi i32 [0, %entry], [%j.inc, %outer.inc]28  call void @llvm.memset.p0.i64(ptr %A, i8 0, i64 4, i32 1, i1 false)29  %j.cmp = icmp slt i32 %j, 230  br i1 %j.cmp, label %reduction.for, label %outer.exit31 32 33    reduction.for:34      %i = phi i32 [0, %outer.for], [%i.inc, %reduction.inc]35      %phi = phi double [0.0, %outer.for], [%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 %phi, 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: skipped possible mapping target because it writes more than one element71