llvm-project
46 строк · 1.0 Кб
1; RUN: opt %loadNPMPolly '-passes=polly-import-jscop,print<polly-simplify>' -polly-import-jscop-postfix=transformed -polly-allow-nonaffine-loops -disable-output < %s | FileCheck %s -match-full-lines
2;
3; Do not remove the store in region_entry. It can be executed multiple times
4; due to being part of a non-affine loop.
5;
6define void @notredundant_region_loop(i32 %n, ptr noalias nonnull %A) {
7entry:
8br label %for
9
10for:
11%j = phi i32 [0, %entry], [%j.inc, %inc]
12%j.cmp = icmp slt i32 %j, %n
13br i1 %j.cmp, label %body, label %exit
14
15
16body:
17%val = fadd double 21.0, 21.0
18br label %region_entry
19
20region_entry:
21store double %val, ptr %A
22%sqr = mul i32 %j, %j
23%cmp = icmp eq i32 %sqr, 42
24br i1 %cmp, label %region_true, label %region_exit
25
26region_true:
27store double 0.0, ptr %A
28br label %region_entry
29
30region_exit:
31br label %inc
32
33
34inc:
35%j.inc = add nuw nsw i32 %j, 1
36br label %for
37
38exit:
39br label %return
40
41return:
42ret void
43}
44
45
46; CHECK: SCoP could not be simplified
47