brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · d33ef99 Raw
55 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<optree>' -polly-print-optree -disable-output < %s | FileCheck %s -match-full-lines2;3; B[j] is overwritten by at least one statement between the4; definition of %val and its use. Hence, it cannot be forwarded.5;6; for (int j = 0; j < n; j += 1) {7; bodyA:8;   double val = B[j];9;   if (j < 1) {10; bodyA_true:11;     B[j] = 0.0;12;   }13;14; bodyB:15;   A[j] = val;16; }17;18define void @func(i32 %n, ptr noalias nonnull %A, ptr noalias nonnull %B) {19entry:20  br label %for21 22for:23  %j = phi i32 [0, %entry], [%j.inc, %inc]24  %j.cmp = icmp slt i32 %j, %n25  br i1 %j.cmp, label %bodyA, label %exit26 27    bodyA:28      %B_idx = getelementptr inbounds double, ptr %B, i32 %j29      %val = load double, ptr %B_idx30      %cond = icmp slt i32 %j, 131      br i1 %cond, label %bodyA_true, label %bodyB32 33    bodyA_true:34      store double 0.0, ptr %B_idx35      br label %bodyB36 37    bodyB:38      %A_idx = getelementptr inbounds double, ptr %A, i32 %j39      store double %val, ptr %A_idx40      br label %inc41 42inc:43  %j.inc = add nuw nsw i32 %j, 144  br label %for45 46exit:47  br label %return48 49return:50  ret void51}52 53 54; CHECK: ForwardOpTree executed, but did not modify anything55