brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 0729241 Raw
57 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<optree>' -polly-print-optree -disable-output < %s | FileCheck %s -match-full-lines2;3; Ensure we do not move instructions from region statements in case the4; instruction to move loads from an array which is also written to from5; within the region. This is necessary as complex region statements may prevent6; us from detecting possible memory conflicts.7;8; for (int j = 0; j < n; j += 1) {9; bodyA:10;   double val = A[0];11;   if (cond)12;13; bodyA_true:14;     A[0] = 42;15;16; bodyB:17;     A[0] = val;18; }19;20define void @func(i32 %n, ptr noalias nonnull %A) {21entry:22  br label %for23 24for:25  %j = phi i32 [0, %entry], [%j.inc, %inc]26  %j.cmp = icmp slt i32 %j, %n27  br i1 %j.cmp, label %bodyA, label %exit28 29    bodyA:30      %val = load double, ptr %A31      %cond = fcmp oeq double 21.0, 21.032      br i1 %cond, label %bodyA_true, label %bodyB33 34    bodyA_true:35      store double 42.0, ptr %A36      br label %bodyB37 38    bodyB:39      store double %val, ptr %A40      br label %bodyB_exit41 42    bodyB_exit:43      br label %inc44 45inc:46  %j.inc = add nuw nsw i32 %j, 147  br label %for48 49exit:50  br label %return51 52return:53  ret void54}55 56; CHECK: ForwardOpTree executed, but did not modify anything57