xref: /llvm-project/polly/test/Simplify/redundant_storebetween.ll (revision e1f056f692d869708c1898d9d65a69ac5584a0ed)
1; RUN: opt %loadNPMPolly "-passes=scop(print<polly-simplify>)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines
2;
3; Don't remove store where there is another store to the same target
4; in-between them.
5;
6; for (int j = 0; j < n; j += 1)
7;   A[0] = A[0];
8;
9define void @func(i32 %n, ptr noalias nonnull %A) {
10entry:
11  br label %for
12
13for:
14  %j = phi i32 [0, %entry], [%j.inc, %inc]
15  %j.cmp = icmp slt i32 %j, %n
16  br i1 %j.cmp, label %body, label %exit
17
18    body:
19      %A_idx = getelementptr inbounds double, ptr %A, i32 %j
20      %val = load double, ptr %A_idx
21      store double 0.0, ptr %A
22      store double %val, ptr %A_idx
23      br label %inc
24
25inc:
26  %j.inc = add nuw nsw i32 %j, 1
27  br label %for
28
29exit:
30  br label %return
31
32return:
33  ret void
34}
35
36
37; CHECK: SCoP could not be simplified
38
39