llvm-project
52 строки · 1.4 Кб
1; RUN: opt %loadNPMPolly '-passes=print<polly-function-scops>,polly-scop-printer' -disable-output < %s
2;
3; Check that the ScopPrinter does not crash.
4; ScopPrinter needs the ScopDetection pass, which should depend on
5; ScalarEvolution transitively.
6;
7; FIXME: -dot-scops always prints to the same hardcoded filename
8; scops.<functionname>.dot. If there is another test with the same
9; function name and printing a dot file there will be a race condition
10; when running tests in parallel.
11
12target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
13
14define void @func(i32 %n, i32 %m, ptr noalias nonnull %A) {
15entry:
16br label %outer.for
17
18outer.for:
19%j = phi i32 [0, %entry], [%j.inc, %outer.inc]
20%j.cmp = icmp slt i32 %j, %n
21br i1 %j.cmp, label %inner.for, label %outer.exit
22
23inner.for:
24%i = phi i32 [1, %outer.for], [%i.inc, %inner.inc]
25%b = phi double [0.0, %outer.for], [%a, %inner.inc]
26%i.cmp = icmp slt i32 %i, %m
27br i1 %i.cmp, label %body1, label %inner.exit
28
29body1:
30%A_idx = getelementptr inbounds double, ptr %A, i32 %i
31%a = load double, ptr %A_idx
32store double %a, ptr %A_idx
33br label %inner.inc
34
35inner.inc:
36%i.inc = add nuw nsw i32 %i, 1
37br label %inner.for
38
39inner.exit:
40br label %outer.inc
41
42outer.inc:
43store double %b, ptr %A
44%j.inc = add nuw nsw i32 %j, 1
45br label %outer.for
46
47outer.exit:
48br label %return
49
50return:
51ret void
52}
53