llvm-project
40 строк · 888.0 Байт
1; RUN: opt %loadPolly -polly-import-jscop-postfix=transformed -polly-print-import-jscop -polly-print-simplify -disable-output < %s | FileCheck %s -match-full-lines
2;
3; Remove a redundant store, if its partial domain is a subset of the
4; read's domain.
5;
6define void @redundant_partialwrite(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
15body:
16%val = load double, ptr %A
17store double %val, ptr %A
18br label %inc
19
20inc:
21%j.inc = add nuw nsw i32 %j, 1
22br label %for
23
24exit:
25br label %return
26
27return:
28ret void
29}
30
31
32; Check successful import.
33; CHECK: new: [n] -> { Stmt_body[i0] -> MemRef_A[0] : i0 <= 15 };
34
35; CHECK: Statistics {
36; CHECK: Redundant writes removed: 1
37; CHECK: }
38
39; CHECK: After accesses {
40; CHECK-NEXT: }
41