optimize away stackrestore calls that have no intervening alloca or call.
[oota-llvm.git] / test / Transforms / InstCombine / cast-load-gep.ll
1 ; RUN: llvm-upgrade < %s | llvm-as | 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 %unop = type {int }
8 %op = type {float}
9
10 %Array = internal constant [1 x %op* (%op*)*] [ %op* (%op*)* %foo ]
11
12 implementation
13
14 %op* %foo(%op* %X) {
15   ret %op* %X
16 }
17
18 %unop* %caller(%op* %O) {
19    %tmp = load %unop* (%op*)** cast ([1 x %op* (%op*)*]* %Array to %unop* (%op*)**)
20    %tmp.2 = call %unop* (%op*)* %tmp(%op* %O)
21    ret %unop* %tmp.2
22 }
23