1 ; RUN: opt -basicaa -loop-distribute -enable-loop-distribute -verify-loop-info -verify-dom-info -S \
2 ; RUN: < %s | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 define void @fn1(i64 %a, i64* %b) {
12 %add75.epil = phi i64 [ %add7.epil, %for.body ], [ %a, %entry ]
13 %add1.epil = add nsw i64 %add75.epil, 268435457
14 %arrayidx.epil = getelementptr inbounds i64, i64* %b, i64 %add1.epil
15 %load = load i64, i64* %arrayidx.epil, align 8
16 %add5.epil = add nsw i64 %add75.epil, 805306369
17 %arrayidx6.epil = getelementptr inbounds i64, i64* %b, i64 %add5.epil
18 store i64 %load, i64* %arrayidx6.epil, align 8
19 %add7.epil = add nsw i64 %add75.epil, 2
20 %epil.iter.cmp = icmp eq i64 %add7.epil, 0
21 br i1 %epil.iter.cmp, label %for.end, label %for.body
23 ; CHECK: %[[phi:.*]] = phi i64
24 ; CHECK: %[[add1:.*]] = add nsw i64 %[[phi]], 268435457
25 ; CHECK: %[[gep1:.*]] = getelementptr inbounds i64, i64* %b, i64 %[[add1]]
26 ; CHECK: %[[load:.*]] = load i64, i64* %[[gep1]], align 8
27 ; CHECK: %[[add2:.*]] = add nsw i64 %[[phi]], 805306369
28 ; CHECK: %[[gep2:.*]] = getelementptr inbounds i64, i64* %b, i64 %[[add2]]
29 ; CHECK: store i64 %[[load]], i64* %[[gep2]], align 8
30 ; CHECK: %[[incr:.*]] = add nsw i64 %[[phi]], 2
31 ; CHECK: %[[cmp:.*]] = icmp eq i64 %[[incr]], 0
32 ; CHECK: br i1 %[[cmp]]