[opaque pointer type] Add textual IR support for explicit type parameter to gep operator
[oota-llvm.git] / test / Transforms / GVN / 2007-07-26-InterlockingLoops.ll
1 ; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
2
3 @last = external global [65 x i32*]
4
5 define i32 @NextRootMove(i32 %wtm, i32 %x, i32 %y, i32 %z) {
6 entry:
7         %A = alloca i32*
8         %tmp17618 = load i32*, i32** getelementptr ([65 x i32*], [65 x i32*]* @last, i32 0, i32 1), align 4
9         store i32* %tmp17618, i32** %A
10 ; CHECK: entry:
11 ; CHECK-NEXT: alloca i32
12 ; CHECK-NEXT: %tmp17618 = load
13 ; CHECK-NOT: load
14 ; CHECK-NOT: phi
15         br label %cond_true116
16
17 cond_true116:
18    %cmp = icmp eq i32 %x, %y
19         br i1 %cmp, label %cond_true128, label %cond_true145
20
21 cond_true128:
22         %tmp17625 = load i32*, i32** getelementptr ([65 x i32*], [65 x i32*]* @last, i32 0, i32 1), align 4
23         store i32* %tmp17625, i32** %A
24    %cmp1 = icmp eq i32 %x, %z
25         br i1 %cmp1 , label %bb98.backedge, label %return.loopexit
26
27 bb98.backedge:
28         br label %cond_true116
29
30 cond_true145:
31         %tmp17631 = load i32*, i32** getelementptr ([65 x i32*], [65 x i32*]* @last, i32 0, i32 1), align 4
32         store i32* %tmp17631, i32** %A
33         br i1 false, label %bb98.backedge, label %return.loopexit
34
35 return.loopexit:
36         br label %return
37
38 return:
39         ret i32 0
40 }