aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode
AgeCommit message (Collapse)Author
2007-10-05Removing the silly CHelpers header by rolling wrap and unwrap into the CGordon Henriksen
bindings headers themselves, hidden behind #ifdef __cplusplus. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42666 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-29Demoting CHelpers.h to include/llvm/Support.Gordon Henriksen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42465 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26Make temporaries explicit to avoid prematureDale Johannesen
destruction of compiler-created ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42383 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18C bindings for libLLVMCore.a and libLLVMBitWriter.a.Gordon Henriksen
- The naming prefix is LLVM. - All types are represented using opaque references. - Functions are not named LLVM{Type}{Method}; the names became unreadable goop. Instead, they are named LLVM{ImperativeSentence}. - Where an attribute only appears once in the class hierarchy (e.g., linkage only applies to values; parameter types only apply to function types), the class is omitted from identifiers for brevity. Tastes like methods. - Strings are C strings or string/length tuples on a case-by-case basis. - APIs which give the caller ownership of an object are not mapped (removeFromParent, certain constructor overloads). This keeps keep memory management as simple as possible. For each library with bindings: llvm-c/<LIB>.h - Declares the bindings. lib/<LIB>/<LIB>.cpp - Implements the bindings. So just link with the library of your choice and use the C header instead of the C++ one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42077 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-12Revise previous patch per review comments.Dale Johannesen
Next round of x87 long double stuff. Getting close now, basically works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41875 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-11Add APInt interfaces to APFloat (allows directlyDale Johannesen
access to bits). Use them in place of float and double interfaces where appropriate. First bits of x86 long double constants handling (untested, probably does not work). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41858 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-07Revert previous change to IR.Dale Johannesen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41769 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-06Next round of APFloat changes.Dale Johannesen
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.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41747 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-04Update GEP constructors to use an iterator interface to fixDavid Greene
GLIBCXX_DEBUG issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41697 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-27Update InvokeInst to work like CallInstDavid Greene
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41506 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-09Patch 10 for long double. Doing constants right needs expanding ConstantFPDale Johannesen
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40974 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04This is the patch to provide clean intrinsic function overloading support in ↵Chandler Carruth
LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future. This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40807 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03Long double, part 1 of N. Support in IR.Dale Johannesen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40774 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01New CallInst interface to address GLIBCXX_DEBUG errors caused byDavid Greene
indexing an empty std::vector. Updates to all clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40660 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05remove a dead caseChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37916 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05Here is the bulk of the sanitizing.Gabor Greif
Almost all occurrences of "bytecode" in the sources have been eliminated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37913 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-18Fix PR1434 and test/Linker/link-archive.ll, this is a regression from 1.9.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37204 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-15implement the ModuleProvider::dematerializeFunction hookChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37080 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-11allow partially materialized modules to be written out, which just strips outChris Lattner
the functions which haven't been read. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36999 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-08Make a preemptive bitcode format change to support PR1146. This lets us doChris Lattner
pr1146 in llvm 2.1 without ugly code to emulate old behavior. This should be merged into the 2.0 release branch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36928 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06fix off-by-one that caused the llvm2cpp test to failChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36880 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06Flush the file after writing bitcode so that clients who don't close theirChris Lattner
ofstreams will be ok. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06Fix a nasty problem where we would miss enumeration of some types. This fixesChris Lattner
issues with CE_CAST etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36864 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06Allow structs with zero fields.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36862 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06add a missing checkChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36859 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06Keep header file free of 'possible loss of data' warnings.Jeff Cohen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36832 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06Unbreak VC++.Jeff Cohen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36831 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06add abbrevs for binops and casts. This shrinks a testcase from 725132->682500Chris Lattner
bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36829 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06add a new CreateBitcodeWriterPass method, which creates a bitcode writer asChris Lattner
a pass git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36828 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06implement reading/writing of inlineasm objectsChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36827 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06add some abbrevs for ret and unreachable, shrinking kc++ from 2717360->2705388Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36823 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06enumerate the operands of a constant before we enumerate the constant itselfChris Lattner
This avoids fwd references in the reader. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36822 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06add a denser encoding for null terminated strings, add a 6-bit abbrev asChris Lattner
well. This shrinks kc++ from 2724088 to 2717360 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36821 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06add an abbreviation for the string constants opzn, shrinking the constnatsChris Lattner
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36820 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06implement the 'string constant' optimization. This shrinks kc.bit fromChris Lattner
2878544 to 2815788 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06further reduce the redundancy of types in the instruction encoding. ThisChris Lattner
shrinks function bodies in kc++ from 891913B to 884073B git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36817 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06stop encoding type/value pairs when the type is implied by the value.Chris Lattner
This shrinks the function block of kc++ from 1055K to 906K git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36816 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-05add support for BLOCKINFO records at the module level. This fixes the readerChris Lattner
issues reid noticed last night. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36785 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-05add an abbrev for loads. This shrinks the function block about 50K, from:Chris Lattner
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36779 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-05add abbrevs for the constants tables. This shrinks it from 4.49755e6 bitsChris Lattner
to 3.85972e6 bits in kc++ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36778 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-05Add abbreviations to the TYPE_BLOCK for pointers, functions, structs and arrays.Chris Lattner
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-05add a char6 abbrev for bbnames and value names. This represents each characterChris Lattner
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36771 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-05add an abbreviation for the type symtab, this shrinks the TST from 175197 bitsChris Lattner
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36769 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-05Implement support for globally associating abbrevs with block IDs, whichChris Lattner
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 :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36767 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04allow the 8-bit abbrev to be used for either bb or other valuesChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36761 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04shave another 150K off of kc++, by using a 7-bit encoding for BB namesChris Lattner
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? :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36759 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04where possible, encode symtab names with 7 bits per char instead of 8. ThisChris Lattner
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36758 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04Encode all value symtab strings as arrays of 8-bit fixed width integers,Chris Lattner
instead of the default inefficient encoding. This shrinks kc++ from 4134K to 3629K git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36755 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04eliminate internal length fields from record. Records already know theirChris Lattner
total length git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36752 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04stub out creation of BLOCKINFO_BLOCKChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36749 91177308-0d34-0410-b5e6-96231b3b80d8