brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 0b75c16 Raw
80 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<delicm>' -polly-print-delicm -pass-remarks-missed=polly-delicm -disable-output < %s 2>&1 | 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;          phi += 4.2;8;          if (phi > 42.0)9;            (void)A[j];10;          else11;            A[j] = 0.0;12;        A[j] = phi;13;      }14;    }15;16define void @func(ptr noalias nonnull %A) {17entry:18  br label %outer.preheader19 20outer.preheader:21  br label %outer.for22 23outer.for:24  %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]25  %j.cmp = icmp slt i32 %j, 226  br i1 %j.cmp, label %reduction.preheader, label %outer.exit27 28 29    reduction.preheader:30      br label %reduction.for31 32    reduction.for:33      %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]34      %phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]35      %i.cmp = icmp slt i32 %i, 436      br i1 %i.cmp, label %body, label %reduction.exit37 38 39 40        body:41          %add = fadd double %phi, 4.242          %A_idxp = getelementptr inbounds double, ptr %A, i32 %j43          %add.cmp = fcmp ogt double %add, 42.044          br i1 %add.cmp , label %body_true, label %body_false45 46        body_true:47          %dummy = load double, ptr %A_idxp48          br label %reduction.inc49 50        body_false:51          store double 0.0, ptr %A_idxp52          br label %reduction.inc53 54 55 56    reduction.inc:57      %i.inc = add nuw nsw i32 %i, 158      br label %reduction.for59 60    reduction.exit:61      %A_idx = getelementptr inbounds double, ptr %A, i32 %j62      store double %phi, ptr %A_idx63      br label %outer.inc64 65 66 67outer.inc:68  %j.inc = add nuw nsw i32 %j, 169  br label %outer.for70 71outer.exit:72  br label %return73 74return:75  ret void76}77 78 79; CHECK: store is in a non-affine subregion80