Commit Graph

28 Commits

Author SHA1 Message Date
Dan Gohman
309b3af547 Extend function-local metadata to be usable as attachments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 02:24:03 +00:00
Dan Gohman
17aa92c92a Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 23:38:33 +00:00
Devang Patel
6209869f83 Speedup bitcode writer. Do not walk all values for all functions to emit function local metadata. In one testcase, probably worst case scenario, the 70x speed up is seen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105360 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02 23:05:04 +00:00
Devang Patel
bc5201f837 Remove MetadataBase class because it is not adding significant value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-22 22:52:10 +00:00
Victor Hernandez
d7e6457c3f Simplify code that chooses when to enumerate function-local metadata operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93446 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 19:54:11 +00:00
Victor Hernandez
3cd7c3db99 Avoid modifying ValueEnumerator's MD ValueList by choosing which function-local MD to write based on the function currently being written
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93441 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 19:38:44 +00:00
Victor Hernandez
ab9cd10721 Enumerate function-local metadata (and its types and operands) only during function-incorporation, global metadata continues to be enumerated during creation of ValueEnumerator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 19:36:16 +00:00
Devang Patel
8fba578be7 Derive NamedMDNode from Value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 00:30:14 +00:00
Devang Patel
0386f01e06 Use separate namespace for named metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92931 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:39:36 +00:00
Chris Lattner
837e04a8bf bitcode writer support for blockaddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 05:24:40 +00:00
Devang Patel
e8e0213cc3 Write and read metadata attachments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 19:26:43 +00:00
Devang Patel
d5ac40457b Use separate ValueList for metadata.
This fixes PR4666.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78056 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 06:00:18 +00:00
Nick Lewycky
f7e498138f Don't remove aggregate-typed module level constants before encoding functions
since functions may contain aggregate constants too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73220 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 05:20:12 +00:00
Devang Patel
0598866c05 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56622 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 21:00:45 +00:00
Devang Patel
eaf42abab6 s/ParameterAttributes/Attributes/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 23:03:40 +00:00
Chris Lattner
58d74910c6 Reimplement the parameter attributes support, phase #1. hilights:
1. There is now a "PAListPtr" class, which is a smart pointer around
   the underlying uniqued parameter attribute list object, and manages
   its refcount.  It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
   the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
   longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
   ParamAttrsWithIndex's, no need to make a SmallVector of a specific 
   size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
   dereferencing the pointer is simplified to just access the 
   PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
   bit simpler.

Phase #2 will rename some stuff (e.g. PAListPtr) and do other less 
invasive changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48289 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12 17:45:29 +00:00
Chris Lattner
4ee451de36 Remove attribution from file headers, per discussion on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:36:04 +00:00
Chris Lattner
33f1d5b328 Fix a nasty problem where we would miss enumeration of some types. This fixes
issues with CE_CAST etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36864 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06 08:35:19 +00:00
Chris Lattner
6da91d3c2c optimize constant layout. This fixes encoding of 181.mcf (by ensuring
integer structure idx's are emitted before constant expr geps) and shrinks
files slightly.  For example kc++ shrinks from 4326188 to 4240128 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36742 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04 05:21:47 +00:00
Chris Lattner
2020ca2414 pass by reference, not by value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36721 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04 00:45:24 +00:00
Chris Lattner
50954f5cba enumerate parameter attr lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36709 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-03 22:46:43 +00:00
Chris Lattner
b9d0c2a6a0 start code for writing out instructions. Separate BB#s from normal value
#'s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36472 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-26 05:53:54 +00:00
Chris Lattner
c59c0afd7d enumerate BB's separately from other function values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36467 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-26 04:42:16 +00:00
Chris Lattner
8d35c79f27 add support for incorporating and purging functions to the value enumerator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36465 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-26 03:50:57 +00:00
Chris Lattner
198f34ac35 move some code around, fix a bug in the reader reading globalinits (which
I just introduced), stub out function reading, purge aggregate values from
the value table before reading functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36463 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-26 03:27:58 +00:00
Chris Lattner
2edd22b959 Emit module-level constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36384 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 00:16:04 +00:00
Chris Lattner
8c99a8e768 fix off-by one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36377 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 21:23:41 +00:00
Chris Lattner
fd57cecd2c Initial support for writing bitcode files. This currently only writes types,
the type symtab, and global/function protos, and is missing the important
size optimization, but it is a place to start.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36331 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 06:24:45 +00:00