llvm-project
48 строк · 1.7 Кб
1; RUN: opt %loadNPMPolly '-passes=polly-import-jscop,print<polly-simplify>' -polly-import-jscop-postfix=transformed -disable-output < %s | FileCheck %s
2;
3; llvm.org/PR33323
4;
5; Do not remove the pair (store double %add119, read %add119) as redundant
6; because the are in the wrong order.
7
8target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
9
10define fastcc void @pr33323(ptr nocapture %data, ptr nocapture %symmat) {
11entry:
12br label %for.body98
13
14for.cond87.loopexit:
15ret void
16
17for.body98:
18%indvars.iv13 = phi i64 [ 1, %entry ], [ %indvars.iv.next14, %for.end122 ]
19br label %for.body105
20
21for.body105:
22%indvars.iv = phi i64 [ 0, %for.body98 ], [ %indvars.iv.next, %for.body105 ]
23%arrayidx109 = getelementptr inbounds [1000 x double], ptr %data, i64 %indvars.iv, i64 0
24%add119 = fadd double undef, undef
25%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
26%exitcond = icmp eq i64 %indvars.iv.next, 1000
27br i1 %exitcond, label %for.end122, label %for.body105
28
29for.end122:
30%arrayidx130 = getelementptr inbounds [1000 x double], ptr %symmat, i64 %indvars.iv13, i64 0
31store double %add119, ptr %arrayidx130
32%indvars.iv.next14 = add nuw nsw i64 %indvars.iv13, 1
33%exitcond15 = icmp eq i64 %indvars.iv.next14, 1000
34br i1 %exitcond15, label %for.cond87.loopexit, label %for.body98
35}
36
37
38; CHECK: Statistics {
39; CHECK: Redundant writes removed: 1
40; CHECK: Stmts removed: 1
41; CHECK: }
42
43; CHECK: After accesses {
44; CHECK-NEXT: Stmt_for_body105
45; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
46; CHECK-NEXT: { Stmt_for_body105[i0, i1] -> MemRef_add119[] };
47; CHECK-NEXT: new: { Stmt_for_body105[i0, i1] -> MemRef_symmat[1 + i0, 0] };
48; CHECK-NEXT: }
49