mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-24 06:30:19 +00:00
fd90dd5d55
Shrinkify LLVM's footprint by removing the analyze tool and moving its functionality into the opt tool. THis eliminates one of the largest tools from LLVM and doesn't make opt much bigger because it already included most of the analysis passes. To get the old analyze functionality pass the -analyze option to opt. Note that the integeration here is dead simple. The "main" of analyze was just copied to opt and invoked if the -analyze option was given. There may be opportunities for further integration such as removing the distinction between transform passes and analysis passes. To use the analysis functionality, if you previously did this: analyze $FNAME -domset -disable-verify you would now do this: opt -analyze $FNAME -domset -disable-verify Pretty simple. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29762 91177308-0d34-0410-b5e6-96231b3b80d8
30 lines
720 B
LLVM
30 lines
720 B
LLVM
; FIXME: this should be SHM for bu, but change it for now since besides incompleteness
|
|
; this is working
|
|
; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=Y:SHIM && \
|
|
; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=P1:SHM,P2:SHM
|
|
|
|
%G = internal constant [2 x int*(int*)*] [
|
|
int*(int*)* %callee1, int*(int*)* %callee2
|
|
]
|
|
|
|
implementation
|
|
|
|
internal int* %callee1(int* %P1) {
|
|
ret int* %P1
|
|
}
|
|
|
|
internal int* %callee2(int* %P2) {
|
|
%X = malloc int
|
|
ret int* %X
|
|
}
|
|
|
|
void %caller(int %callee) {
|
|
%FPP = getelementptr [2 x int*(int*)*]* %G, int 0, int %callee
|
|
%FP = load int*(int*)** %FPP
|
|
|
|
%Y = alloca int
|
|
%Z = call int* %FP(int* %Y)
|
|
store int 4, int* %Z
|
|
ret void
|
|
}
|