[DeLICM] Add nomap regressions tests. NFC.
[polly-mirror.git] / test / DeLICM / nomap_occupied.ll
blob52e177bd95bb36186922b73babc7ffdb7c6b0c51
1 ; RUN: opt %loadPolly -polly-delicm -analyze < %s | FileCheck %s
3 ;    void func(double *A) {
4 ;      for (int j = 0; j < 2; j += 1) { /* outer */
5 ;        double phi = 0.0;
6 ;        for (int i = 0; i < 4; i += 1) /* reduction */
7 ;          phi += 4.2;
8 ;        dummy = A[j];
9 ;        A[j] = phi;
10 ;      }
11 ;    }
13 ; Check that A[j] is not used for mapping as it is still in use.
15 define void @func(double* noalias nonnull %A) {
16 entry:
17   %fsomeval = fadd double 21.0, 21.0
18   br label %outer.preheader
20 outer.preheader:
21   br label %outer.for
23 outer.for:
24   %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
25   %j.cmp = icmp slt i32 %j, 2
26   br i1 %j.cmp, label %reduction.preheader, label %outer.exit
29     reduction.preheader:
30       br label %reduction.for
32     reduction.for:
33       %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
34       %phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
35       %i.cmp = icmp slt i32 %i, 4
36       br i1 %i.cmp, label %body, label %reduction.exit
40         body:
41           %add = fadd double %phi, 4.2
42           br label %reduction.inc
46     reduction.inc:
47       %i.inc = add nuw nsw i32 %i, 1
48       br label %reduction.for
50     reduction.exit:
51       %A_idx = getelementptr inbounds double, double* %A, i32 %j
52       %dummy = load double, double* %A_idx
53       store double %phi, double* %A_idx
54       br label %outer.inc
58 outer.inc:
59   %j.inc = add nuw nsw i32 %j, 1
60   br label %outer.for
62 outer.exit:
63   br label %return
65 return:
66   ret void
70 ; CHECK: Statistics {
71 ; CHECK:     Compatible overwrites: 1
72 ; CHECK: }
73 ; CHECK: No modification has been made