Dan Gohman | c1be92f | 2010-10-18 18:04:47 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info |& FileCheck %s |
Dan Gohman | 72776d2 | 2009-05-27 01:48:27 +0000 | [diff] [blame] | 2 | ; PR4267 |
| 3 | |
Michael J. Spencer | 17d3983 | 2010-08-30 15:08:02 +0000 | [diff] [blame] | 4 | ; CHECK: MayAlias: double* %p.0.i.0, double* %p3 |
| 5 | |
Dan Gohman | 72776d2 | 2009-05-27 01:48:27 +0000 | [diff] [blame] | 6 | ; %p3 is equal to %p.0.i.0 on the second iteration of the loop, |
| 7 | ; so MayAlias is needed. |
| 8 | |
| 9 | define void @foo([3 x [3 x double]]* noalias %p) { |
| 10 | entry: |
| 11 | %p3 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 0, i64 3 |
| 12 | br label %loop |
| 13 | |
| 14 | loop: |
| 15 | %i = phi i64 [ 0, %entry ], [ %i.next, %loop ] |
| 16 | |
| 17 | %p.0.i.0 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 %i, i64 0 |
| 18 | |
Chris Lattner | d2bf432 | 2011-11-27 06:54:59 +0000 | [diff] [blame] | 19 | store volatile double 0.0, double* %p3 |
| 20 | store volatile double 0.1, double* %p.0.i.0 |
Dan Gohman | 72776d2 | 2009-05-27 01:48:27 +0000 | [diff] [blame] | 21 | |
| 22 | %i.next = add i64 %i, 1 |
| 23 | %cmp = icmp slt i64 %i.next, 3 |
| 24 | br i1 %cmp, label %loop, label %exit |
| 25 | |
| 26 | exit: |
| 27 | ret void |
| 28 | } |