brintos

brintos / llvm-project-archived public Read only

0
0
Text · 876 B · 179b02a Raw
47 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<optree>' -polly-print-optree -disable-output < %s | FileCheck %s -match-full-lines2;3; Do not forward instructions with side-effects (here: function call).4;5; for (int j = 0; j < n; j += 1) {6; bodyA:7;   double val = f();8;9; bodyB:10;   A[0] = val;11; }12;13declare double @f(ptr %A) #114 15define void @func(i32 %n, ptr noalias nonnull %A) {16entry:17  br label %for18 19for:20  %j = phi i32 [0, %entry], [%j.inc, %inc]21  %j.cmp = icmp slt i32 %j, %n22  br i1 %j.cmp, label %bodyA, label %exit23 24    bodyA:25      %val = call double (ptr) @f(ptr %A)26      br label %bodyB27 28    bodyB:29      store double %val, ptr %A30      br label %inc31 32inc:33  %j.inc = add nuw nsw i32 %j, 134  br label %for35 36exit:37  br label %return38 39return:40  ret void41}42 43attributes #1 = { nounwind readnone }44 45 46; CHECK: ForwardOpTree executed, but did not modify anything47