Move a DenseMap's declaration outside of a loop, and just call
[oota-llvm.git] / test / Transforms / InstCombine / cast-load-gep.ll
1 ; RUN: llvm-as < %s | opt -instcombine -globaldce | llvm-dis | \
2 ; RUN:   not grep Array
3
4 ; Pulling the cast out of the load allows us to eliminate the load, and then 
5 ; the whole array.
6
7         %op = type { float }
8         %unop = type { i32 }
9 @Array = internal constant [1 x %op* (%op*)*] [ %op* (%op*)* @foo ]             ; <[1 x %op* (%op*)*]*> [#uses=1]
10
11 define %op* @foo(%op* %X) {
12         ret %op* %X
13 }
14
15 define %unop* @caller(%op* %O) {
16         %tmp = load %unop* (%op*)** bitcast ([1 x %op* (%op*)*]* @Array to %unop* (%op*)**); <%unop* (%op*)*> [#uses=1]
17         %tmp.2 = call %unop* %tmp( %op* %O )            ; <%unop*> [#uses=1]
18         ret %unop* %tmp.2
19 }
20