Teach ScalarEvolution how to reason about no-wrap flags on loops
[llvm/avr.git] / test / Transforms / IndVarSimplify / preserve-gep-remainder.ll
blobd249432eeeb93fe1df9755080cfe5e3c5c79ef1e
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}
4 ; Indvars shouldn't expand this to
5 ;   %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 %tmp, i64 19
6 ; or something. That's valid, but more obscure.
8 define void @foo([3 x [3 x double]]* noalias %p) nounwind {
9 entry:
10   br label %loop
12 loop:
13   %i = phi i64 [ 0, %entry ], [ %i.next, %loop ]
14   %ip = add i64 %i, 1
15   %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 2, i64 %ip, i64 1
16   volatile store double 0.0, double* %p.2.ip.1
17   %i.next = add i64 %i, 1
18   br label %loop