[SandboxIR] Avoid repeated hash lookups (NFC) (#125337)
[llvm-project.git] / polly / test / DeLICM / reject_unusualstore.ll
blob342888c6654f48d8394e4b9cc09b221cf9bd4362
1 ; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb '-passes=print<polly-delicm>' -disable-output < %s | FileCheck %s
2 ; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb -passes=polly-delicm -disable-output -stats < %s 2>&1 | FileCheck %s --check-prefix=STATS
3 ; REQUIRES: asserts
5 ;    void func(double *A) {
6 ;      for (int j = 0; j < 2; j += 1) { /* outer */
7 ;        A[j] = 21.0;
8 ;        A[j] = 42.0;
9 ;        double phi = 0.0;
10 ;        for (int i = 0; i < 4; i += 1) /* reduction */
11 ;          phi += 4.2;
12 ;        A[j] = phi;
13 ;      }
14 ;    }
17 define void @func(ptr noalias nonnull %A) {
18 entry:
19   br label %outer.preheader
21 outer.preheader:
22   br label %outer.for
24 outer.for:
25   %j = phi i32 [0, %outer.preheader], [%j.inc, %outer.inc]
26   %j.cmp = icmp slt i32 %j, 2
27   br i1 %j.cmp, label %reduction.preheader, label %outer.exit
30     reduction.preheader:
31       %A_idx = getelementptr inbounds double, ptr %A, i32 %j
32       store double 21.0, ptr %A_idx
33       store double 42.0, ptr %A_idx
34       br label %reduction.for
36     reduction.for:
37       %i = phi i32 [0, %reduction.preheader], [%i.inc, %reduction.inc]
38       %phi = phi double [0.0, %reduction.preheader], [%add, %reduction.inc]
39       %i.cmp = icmp slt i32 %i, 4
40       br i1 %i.cmp, label %body, label %reduction.exit
44         body:
45           %add = fadd double %phi, 4.2
46           br label %reduction.inc
50     reduction.inc:
51       %i.inc = add nuw nsw i32 %i, 1
52       br label %reduction.for
54     reduction.exit:
55       store double %phi, ptr %A_idx
56       br label %outer.inc
60 outer.inc:
61   %j.inc = add nuw nsw i32 %j, 1
62   br label %outer.for
64 outer.exit:
65   br label %return
67 return:
68   ret void
72 ; CHECK: No modification has been made
73 ; STATS: 1 polly-zone       - Number of not zone-analyzable arrays