• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -indvars -S \
2; RUN:   | grep {\[%\]p.2.ip.1 = getelementptr \\\[3 x \\\[3 x double\\\]\\\]\\* \[%\]p, i64 2, i64 \[%\]tmp, i64 1}
3target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128-n:32:64"
4
5; Indvars shouldn't expand this to
6;   %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 %tmp, i64 19
7; or something. That's valid, but more obscure.
8
9define void @foo([3 x [3 x double]]* noalias %p) nounwind {
10entry:
11  br label %loop
12
13loop:
14  %i = phi i64 [ 0, %entry ], [ %i.next, %loop ]
15  %ip = add i64 %i, 1
16  %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 2, i64 %ip, i64 1
17  volatile store double 0.0, double* %p.2.ip.1
18  %i.next = add i64 %i, 1
19  br label %loop
20}
21