summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Next round of APFloat changes.Dale Johannesen2007-09-061-2/+3
| | | | | | | | | | | | | | Use APFloat in UpgradeParser and AsmParser. Change all references to ConstantFP to use the APFloat interface rather than double. Remove the ConstantFP double interfaces. Use APFloat functions for constant folding arithmetic and comparisons. (There are still way too many places APFloat is just a wrapper around host float/double, but we're getting there.) llvm-svn: 41747
* Patch 10 for long double. Doing constants right needs expanding ConstantFPDale Johannesen2007-08-091-3/+9
| | | | | | | | | | | | to handle values bigger than double. If we assume host==target and host long double works correctly, this is not too bad, but we don't want to have that limitation longterm. I could implement accepting double constants as long double or something like that, which would lead to incorrect codegen with no errors; the more I think about that the worse it seems. Rather than do such a hack that would be backed out later, I'm settling for giving reasonable error messages, for now. llvm-svn: 40974
* Long double, part 1 of N. Support in IR.Dale Johannesen2007-08-031-0/+3
| | | | llvm-svn: 40774
* remove a dead caseChris Lattner2007-07-051-1/+0
| | | | llvm-svn: 37916
* allow partially materialized modules to be written out, which just strips outChris Lattner2007-05-111-0/+1
| | | | | | the functions which haven't been read. llvm-svn: 36999
* Make a preemptive bitcode format change to support PR1146. This lets us doChris Lattner2007-05-081-4/+23
| | | | | | | pr1146 in llvm 2.1 without ugly code to emulate old behavior. This should be merged into the 2.0 release branch. llvm-svn: 36928
* Flush the file after writing bitcode so that clients who don't close theirChris Lattner2007-05-061-0/+3
| | | | | | ofstreams will be ok. llvm-svn: 36878
* Unbreak VC++.Jeff Cohen2007-05-061-1/+1
| | | | llvm-svn: 36831
* add abbrevs for binops and casts. This shrinks a testcase from 725132->682500Chris Lattner2007-05-061-3/+29
| | | | | | bytes. llvm-svn: 36829
* implement reading/writing of inlineasm objectsChris Lattner2007-05-061-6/+16
| | | | llvm-svn: 36827
* add some abbrevs for ret and unreachable, shrinking kc++ from 2717360->2705388Chris Lattner2007-05-061-3/+31
| | | | llvm-svn: 36823
* add a denser encoding for null terminated strings, add a 6-bit abbrev asChris Lattner2007-05-061-8/+36
| | | | | | well. This shrinks kc++ from 2724088 to 2717360 bytes. llvm-svn: 36821
* add an abbreviation for the string constants opzn, shrinking the constnatsChris Lattner2007-05-061-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | block from: Block ID #11 (CONSTANTS_BLOCK): Num Instances: 1722 Total Size: 3.85976e+06b/482470B/120617W % of file: 16.7609 Average Size: 2241.44b/280.18B/70.045W Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 1/0.00058072 Tot/Avg Records: 26423/15.3444 % Abbrev Recs: 69.1746 to: Block ID #11 (CONSTANTS_BLOCK): Num Instances: 1724 Total Size: 2.62406e+06b/328008B/82001.9W % of file: 12.041 Average Size: 1522.08b/190.26B/47.5649W Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 2/0.00116009 Tot/Avg Records: 26280/15.2436 % Abbrev Recs: 68.9992 This shrinks kc++ from 2815788 to 2724088 bytes, which means the bitcode file is now smaller than the bytecode file. llvm-svn: 36820
* implement the 'string constant' optimization. This shrinks kc.bit fromChris Lattner2007-05-061-0/+6
| | | | | | 2878544 to 2815788 llvm-svn: 36818
* further reduce the redundancy of types in the instruction encoding. ThisChris Lattner2007-05-061-20/+12
| | | | | | shrinks function bodies in kc++ from 891913B to 884073B llvm-svn: 36817
* stop encoding type/value pairs when the type is implied by the value.Chris Lattner2007-05-061-35/+48
| | | | | | This shrinks the function block of kc++ from 1055K to 906K llvm-svn: 36816
* add an abbrev for loads. This shrinks the function block about 50K, from:Chris Lattner2007-05-051-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Block ID #12 (FUNCTION_BLOCK): Num Instances: 2344 Total Size: 8.8434e+06b/1.10542e+06B/276356W % of file: 35.6726 Average Size: 3772.78b/471.598B/117.899W Tot/Avg SubBlocks: 4065/1.73422 Tot/Avg Abbrevs: 0/0 Tot/Avg Records: 128487/54.8153 % Abbrev Recs: 0 to: Block ID #12 (FUNCTION_BLOCK): Num Instances: 2344 Total Size: 8.44518e+06b/1.05565e+06B/263912W % of file: 34.6203 Average Size: 3602.89b/450.362B/112.59W Tot/Avg SubBlocks: 4065/1.73422 Tot/Avg Abbrevs: 0/0 Tot/Avg Records: 128487/54.8153 % Abbrev Recs: 22.2077 llvm-svn: 36779
* add abbrevs for the constants tables. This shrinks it from 4.49755e6 bitsChris Lattner2007-05-051-61/+123
| | | | | | to 3.85972e6 bits in kc++ llvm-svn: 36778
* Add abbreviations to the TYPE_BLOCK for pointers, functions, structs and arrays.Chris Lattner2007-05-051-3/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This shrinks the type_block of kc++ from 139901 bits to 99389 bits (0.55% to 0.39% of the file), a 40% reduction. This shrink the record from: Block ID #10 (TYPE_BLOCK): Num Instances: 1 Total Size: 139901b/17487.6B/4371.91W % of file: 0.549306 Num Abbrevs: 0 Num Records: 3203 % Abbrev Recs: 0 to: Block ID #10 (TYPE_BLOCK): Num Instances: 1 Total Size: 99389b/12423.6B/3105.91W % of file: 0.390862 Num Abbrevs: 4 Num Records: 3203 % Abbrev Recs: 99.6566 With a common histogram of: Code Histogram: 1613 POINTER 1100 FUNCTION 255 STRUCT 224 ARRAY 5 INTEGER 2 OPAQUE 1 LABEL 1 DOUBLE 1 VOID 1 NUMENTRY llvm-svn: 36776
* add a char6 abbrev for bbnames and value names. This represents each characterChris Lattner2007-05-051-12/+30
| | | | | | | | | | | | | | | | | | | | | with 6 bits where possible. This shrinks kc++ from 3324164B to 3183584B. The old VST was: Block ID #14 (VALUE_SYMTAB): Total Size: 1.26713e+07b/1.58391e+06B/395978W Average Size: 5403.53b/675.442B/168.86W % of file: 47.6484 The new one is: Block ID #14 (VALUE_SYMTAB): Total Size: 1.15467e+07b/1.44334e+06B/360834W Average Size: 4923.96b/615.495B/153.874W % of file: 45.3368 This is 11% smaller than the VST in the bytecode format. llvm-svn: 36771
* add an abbreviation for the type symtab, this shrinks the TST from 175197 bitsChris Lattner2007-05-051-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | to 103165 bits: Old: Block ID #13 (TYPE_SYMTAB): Num Instances: 1 Total Size: 175197b/21899.6B/5474.91W Average Size: 175197b/21899.6B/5474.91W % of file: 0.657023 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 0/0 Tot/Avg Records: 255/255 % Abbrev Recs: 0 New: Block ID #13 (TYPE_SYMTAB): Num Instances: 1 Total Size: 103165b/12895.6B/3223.91W Average Size: 103165b/12895.6B/3223.91W % of file: 0.387937 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 1/1 Tot/Avg Records: 255/255 % Abbrev Recs: 100 llvm-svn: 36769
* Implement support for globally associating abbrevs with block IDs, whichChris Lattner2007-05-051-42/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | relieves us from having to emit the abbrevs into each instance of the block. This shrinks kc.bit from 3368K to 3333K, but will be a more significant win once instructions are abbreviated. The VST went from: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.29508e+07b/1.61885e+06B/404713W Average Size: 5522.73b/690.342B/172.585W % of file: 48.0645 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 7035/3 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 to: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.26713e+07b/1.58391e+06B/395978W Average Size: 5403.53b/675.442B/168.86W % of file: 47.5198 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 0/0 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 because we didn't emit the same 3 abbrevs 2345 times :) llvm-svn: 36767
* allow the 8-bit abbrev to be used for either bb or other valuesChris Lattner2007-05-041-6/+6
| | | | llvm-svn: 36761
* shave another 150K off of kc++, by using a 7-bit encoding for BB namesChris Lattner2007-05-041-1/+12
| | | | | | | | | | | | | | | | | | where we can. This shrinks kc++'s down to 3368K, with a VST record of: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.29508e+07b/1.61885e+06B/404713W Average Size: 5522.73b/690.342B/172.585W % of file: 48.0645 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 7035/3 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 100 Isn't it nice to be able to optimizer bc size without touching the reader? :) llvm-svn: 36759
* where possible, encode symtab names with 7 bits per char instead of 8. ThisChris Lattner2007-05-041-11/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | shaves 110K off kc++ to 3514K. Before: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.50425e+07b/1.88031e+06B/470077W Average Size: 6414.69b/801.837B/200.459W % of file: 51.8057 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 2345/1 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 85.1791 after: Block ID #14 (VALUE_SYMTAB): Num Instances: 2345 Total Size: 1.41229e+07b/1.76536e+06B/441341W Average Size: 6022.56b/752.82B/188.205W % of file: 50.2295 Tot/Avg SubBlocks: 0/0 Tot/Avg Abbrevs: 4690/2 Tot/Avg Records: 120924/51.5667 % Abbrev Recs: 85.1791 llvm-svn: 36758
* Encode all value symtab strings as arrays of 8-bit fixed width integers,Chris Lattner2007-05-041-15/+15
| | | | | | | instead of the default inefficient encoding. This shrinks kc++ from 4134K to 3629K llvm-svn: 36755
* eliminate internal length fields from record. Records already know theirChris Lattner2007-05-041-11/+12
| | | | | | total length llvm-svn: 36752
* stub out creation of BLOCKINFO_BLOCKChris Lattner2007-05-041-0/+25
| | | | llvm-svn: 36749
* fix encoding of invoke instructions. kc++ now round tripsChris Lattner2007-05-041-1/+0
| | | | llvm-svn: 36737
* encode and read param attrs along with function type. WE can now roundtrip ↵Chris Lattner2007-05-041-2/+2
| | | | | | Olden/voronoi loslessly llvm-svn: 36735
* fix a bug encoding param attrsChris Lattner2007-05-041-1/+1
| | | | llvm-svn: 36730
* add writer support for param attrsChris Lattner2007-05-041-1/+15
| | | | llvm-svn: 36724
* trivial scaffolding for param attrsChris Lattner2007-05-041-0/+12
| | | | llvm-svn: 36720
* Encoding calling conv info in call/invoke instrs, tree add now round trips ↵Chris Lattner2007-05-031-2/+3
| | | | | | completely llvm-svn: 36707
* don't bother encoding # varargsChris Lattner2007-05-031-1/+0
| | | | llvm-svn: 36705
* fix encoding of BB names in the symtabChris Lattner2007-05-031-4/+10
| | | | llvm-svn: 36704
* add reader logic for terminator instrs.Chris Lattner2007-05-021-2/+0
| | | | llvm-svn: 36642
* use the correct code for binop instrsChris Lattner2007-05-021-1/+1
| | | | llvm-svn: 36639
* fix build with non-buggy compilersChris Lattner2007-05-011-10/+11
| | | | llvm-svn: 36621
* write the symbol table for function bodiesChris Lattner2007-05-011-30/+33
| | | | llvm-svn: 36610
* encode all of the instructions.Chris Lattner2007-05-011-3/+166
| | | | llvm-svn: 36609
* Implement visibility checking during linking. Also implement protectedAnton Korobeynikov2007-04-291-2/+3
| | | | | | visibility support for bitcode. llvm-svn: 36577
* Fix this to use the right block IDChris Lattner2007-04-291-3/+1
| | | | llvm-svn: 36550
* moved Writer.cpp -> BitcodeWriter.cpp to make it more unique in the tree.Chris Lattner2007-04-291-1/+1
| | | | llvm-svn: 36549
* start code for writing out instructions. Separate BB#s from normal valueChris Lattner2007-04-261-1/+66
| | | | | | #'s. llvm-svn: 36472
* add support for incorporating and purging functions to the value enumeratorChris Lattner2007-04-261-1/+3
| | | | llvm-svn: 36465
* improve a commentChris Lattner2007-04-261-3/+5
| | | | llvm-svn: 36464
* move some code around, fix a bug in the reader reading globalinits (whichChris Lattner2007-04-261-66/+86
| | | | | | | I just introduced), stub out function reading, purge aggregate values from the value table before reading functions. llvm-svn: 36463
* add bitcode alias supportChris Lattner2007-04-261-0/+12
| | | | llvm-svn: 36461
* implement reading and writing of constant exprs.Chris Lattner2007-04-241-9/+97
| | | | llvm-svn: 36394
OpenPOWER on IntegriCloud