1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-02 00:42:52 +01:00
llvm-mirror/test/Transforms/InstCombine/cast-load-gep.ll
Tanya Lattner 9aa573954c Remove llvm-upgrade and update tests.
llvm-svn: 48103
2008-03-09 08:16:40 +00:00

21 lines
671 B
LLVM

; RUN: llvm-as < %s | opt -instcombine -globaldce | llvm-dis | \
; RUN: not grep Array
; Pulling the cast out of the load allows us to eliminate the load, and then
; the whole array.
%op = type { float }
%unop = type { i32 }
@Array = internal constant [1 x %op* (%op*)*] [ %op* (%op*)* @foo ] ; <[1 x %op* (%op*)*]*> [#uses=1]
define %op* @foo(%op* %X) {
ret %op* %X
}
define %unop* @caller(%op* %O) {
%tmp = load %unop* (%op*)** bitcast ([1 x %op* (%op*)*]* @Array to %unop* (%op*)**); <%unop* (%op*)*> [#uses=1]
%tmp.2 = call %unop* %tmp( %op* %O ) ; <%unop*> [#uses=1]
ret %unop* %tmp.2
}