xref: /llvm-project/polly/test/Simplify/nocoalesce_elementmismatch.ll (revision e1f056f692d869708c1898d9d65a69ac5584a0ed)
1; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb '-passes=polly-import-jscop,print<polly-simplify>' -polly-import-jscop-postfix=transformed -disable-output < %s | FileCheck -match-full-lines %s
2;
3; Do not combine stores that do not write to different elements in the
4; same instance.
5;
6; for (int j = 0; j < n; j += 1) {
7;   A[0] = 21.0;
8;   A[0] = 42.0;
9; }
10;
11define void @nocoalesce_elementmismatch(i32 %n, ptr noalias nonnull %A) {
12entry:
13  br label %for
14
15for:
16  %j = phi i32 [0, %entry], [%j.inc, %inc]
17  %j.cmp = icmp slt i32 %j, %n
18  br i1 %j.cmp, label %body, label %exit
19
20    body:
21      %A_1 = getelementptr inbounds double, ptr %A, i32 1
22      store double 42.0, ptr %A
23      store double 42.0, ptr %A_1
24      br label %inc
25
26inc:
27  %j.inc = add nuw nsw i32 %j, 1
28  br label %for
29
30exit:
31  br label %return
32
33return:
34  ret void
35}
36
37
38; CHECK: SCoP could not be simplified
39