mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
69ccadd753
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32115 91177308-0d34-0410-b5e6-96231b3b80d8
23 lines
535 B
LLVM
23 lines
535 B
LLVM
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -globaldce | llvm-dis | not grep Array
|
|
|
|
; Pulling the cast out of the load allows us to eliminate the load, and then
|
|
; the whole array.
|
|
|
|
%unop = type {int }
|
|
%op = type {float}
|
|
|
|
%Array = internal constant [1 x %op* (%op*)*] [ %op* (%op*)* %foo ]
|
|
|
|
implementation
|
|
|
|
%op* %foo(%op* %X) {
|
|
ret %op* %X
|
|
}
|
|
|
|
%unop* %caller(%op* %O) {
|
|
%tmp = load %unop* (%op*)** cast ([1 x %op* (%op*)*]* %Array to %unop* (%op*)**)
|
|
%tmp.2 = call %unop* (%op*)* %tmp(%op* %O)
|
|
ret %unop* %tmp.2
|
|
}
|
|
|