mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-25 00:33:15 +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
40 lines
1.2 KiB
LLVM
40 lines
1.2 KiB
LLVM
;
|
|
; RUN: opt -analyze %s -tddatastructure
|
|
%crazy = type [2 x { [2 x sbyte], short } ]
|
|
|
|
implementation
|
|
|
|
sbyte *%test1(%crazy* %P1) { ; No merging, constant indexing
|
|
%P = getelementptr %crazy* %P1, long 0, long 0, ubyte 0, long 1
|
|
ret sbyte *%P
|
|
}
|
|
|
|
sbyte *%test2(%crazy* %P1) { ; No merging, constant indexing
|
|
%P = getelementptr %crazy* %P1, long 0, long 1, ubyte 0, long 0
|
|
ret sbyte *%P
|
|
}
|
|
|
|
sbyte *%test3(%crazy* %P1) { ; No merging, constant indexing, must handle outter index
|
|
%P = getelementptr %crazy* %P1, long -1, long 0, ubyte 0, long 0
|
|
ret sbyte *%P
|
|
}
|
|
|
|
sbyte *%mtest1(%crazy* %P1, long %idx) { ; Merging deepest array
|
|
%P = getelementptr %crazy* %P1, long 0, long 0, ubyte 0, long %idx
|
|
ret sbyte *%P
|
|
}
|
|
sbyte *%mtest2(%crazy* %P1, long %idx) { ; Merge top array
|
|
%P = getelementptr %crazy* %P1, long 0, long %idx, ubyte 0, long 1
|
|
ret sbyte *%P
|
|
}
|
|
sbyte *%mtest3(%crazy* %P1, long %idx) { ; Merge array %crazy is in
|
|
%P = getelementptr %crazy* %P1, long %idx, long 0, ubyte 0, long 1
|
|
ret sbyte *%P
|
|
}
|
|
|
|
sbyte *%m2test1(%crazy* %P1, long %idx) { ; Merge two arrays
|
|
%P = getelementptr %crazy* %P1, long 0, long %idx, ubyte 0, long %idx
|
|
ret sbyte *%P
|
|
}
|
|
|