[DeLICM] Add nomap regressions tests. NFC.
[polly-mirror.git] / test / DeLICM / nomap_storagesize.ll
blob5f96d127f42c5811ce3a842158cd366a169dcf11
1 ; RUN: opt %loadPolly -polly-delicm -analyze < %s | FileCheck %s
3 ;    void func(float *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 ;        A[j] = fsomeval;
9 ;      }
10 ;    }
12 ; Check that %fphi is not mapped to A[j] because it is double-sized,
13 ; but A[j] stores only floats.
15 define void @func(float* noalias nonnull %A) {
16 entry:
17   br label %outer.preheader
19 outer.preheader:
20   br label %outer.for
22 outer.for:
23   %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
24   %j.cmp = icmp slt i32 %j, 2
25   br i1 %j.cmp, label %reduction.preheader, label %outer.exit
28     reduction.preheader:
29       br label %reduction.for
31     reduction.for:
32       %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
33       %phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
34       %i.cmp = icmp slt i32 %i, 4
35       br i1 %i.cmp, label %body, label %reduction.exit
39         body:
40           %add = fadd double %phi, 4.2
41           br label %reduction.inc
45     reduction.inc:
46       %i.inc = add nuw nsw i32 %i, 1
47       br label %reduction.for
49     reduction.exit:
50       %A_idx = getelementptr inbounds float, float* %A, i32 %j
51       %fphi = fptrunc double %phi to float
52       store float %fphi, float* %A_idx
53       br label %outer.inc
57 outer.inc:
58   %j.inc = add nuw nsw i32 %j, 1
59   br label %outer.for
61 outer.exit:
62   br label %return
64 return:
65   ret void
69 ; CHECK: Statistics {
70 ; CHECK:     Compatible overwrites: 1
71 ; CHECK: }
72 ; CHECK: No modification has been made