mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-21 16:31:16 +00:00
76806b6a43
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48103 91177308-0d34-0410-b5e6-96231b3b80d8
21 lines
671 B
LLVM
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
|
|
}
|
|
|