aboutsummaryrefslogtreecommitdiffstats
path: root/test/Analysis/BasicAA/constant-over-index.ll
blob: 232533cc73e11ec74f6f2bd5e3e9c4dbab7e9ffe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s
; PR4267

; CHECK: MayAlias: double* %p.0.i.0, double* %p3

; %p3 is equal to %p.0.i.0 on the second iteration of the loop,
; so MayAlias is needed.

define void @foo([3 x [3 x double]]* noalias %p) {
entry:
  %p3 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 0, i64 3
  br label %loop

loop:
  %i = phi i64 [ 0, %entry ], [ %i.next, %loop ]

  %p.0.i.0 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 %i, i64 0

  store volatile double 0.0, double* %p3
  store volatile double 0.1, double* %p.0.i.0

  %i.next = add i64 %i, 1
  %cmp = icmp slt i64 %i.next, 3
  br i1 %cmp, label %loop, label %exit

exit:
  ret void
}