Commit Graph

75 Commits

Author SHA1 Message Date
Ted Kremenek
8308a48536 Fixed warning concerning implicit conversion from a NULL pointer
constant to an unsigned int.  We now just directly assign the literal 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43459 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 18:43:39 +00:00
Ted Kremenek
adc9b9c317 Fixed assertion in Deserializer::~Deserializer that checks for
pointers that were not backpatched (previously checked the wrong invariant).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43425 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-28 23:38:38 +00:00
Ted Kremenek
5973ef40ca Updated backpatching logic during object deserialization to perform
eager backpatching instead of waithing until all objects have been
deserialized.  This allows us to reduce the memory footprint needed
for backpatching.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43422 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-28 21:17:59 +00:00
Ted Kremenek
1a43e5ffe1 Added serialization support for APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43405 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 21:50:10 +00:00
Ted Kremenek
3bd9dcc08f Updated backpatching during object deserialization to support "smart"
pointers that employ unused bits in a pointer to store extra data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43373 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 23:40:35 +00:00
Hartmut Kaiser
0fcf68a5e0 Disambiguated variable name to comply with VC++'s archaic variable scoping rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43369 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 22:57:48 +00:00
Ted Kremenek
2423e03ca8 Added special treatment of serializing NULL pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43357 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 18:42:52 +00:00
Ted Kremenek
fe2a012338 Implemented prototype serialization of pointers, including support
for backpatching.

Added Deserialize::ReadVal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43319 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 00:10:21 +00:00
Ted Kremenek
6e9b496643 Split Serialization.h into separate headers: Serialize.h and
Deserialize.h Serialization.h now includes trait speciailizations for
unsigned long, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43307 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24 19:06:40 +00:00
Ted Kremenek
0b2d7aaf5c Added preliminary implementation of generic object serialization to bitcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43261 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23 21:29:33 +00:00
Dale Johannesen
a471c2ecda Next PPC long double bits. First cut at constants.
No compile-time support for constant operations yet,
just format transformations.  Make readers and
writers work.  Split constants into 2 doubles in
Legalize.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42865 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 18:07:22 +00:00
Dale Johannesen
9d5f456077 Revise previous patch per review comments.
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-12 03:30:33 +00:00
Dale Johannesen
3f6eb7419d Add APInt interfaces to APFloat (allows directly
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-11 18:32:33 +00:00
Dale Johannesen
073d48da50 Revert previous change to IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41769 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-07 18:31:50 +00:00
Dale Johannesen
43421b3dd7 Next round of APFloat changes.
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-06 18:13:44 +00:00
David Greene
b8f74793b9 Update GEP constructors to use an iterator interface to fix
GLIBCXX_DEBUG issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41697 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-04 15:46:09 +00:00
David Greene
f1355a55f8 Update InvokeInst to work like CallInst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41506 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-27 19:04:21 +00:00
Dale Johannesen
ebbc95da49 Patch 10 for long double. Doing constants right needs expanding ConstantFP
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-09 22:51:36 +00:00
Chandler Carruth
6994040a95 This is the patch to provide clean intrinsic function overloading support in 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-04 01:51:18 +00:00
Dale Johannesen
320fc8a39e Long double, part 1 of N. Support in IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40774 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 01:03:46 +00:00
David Greene
52eec54820 New CallInst interface to address GLIBCXX_DEBUG errors caused by
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-08-01 03:43:44 +00:00
Gabor Greif
a99be51bf5 Here is the bulk of the sanitizing.
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-07-05 17:07:56 +00:00
Chris Lattner
b348bb8125 Fix PR1434 and test/Linker/link-archive.ll, this is a regression from 1.9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37204 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-18 04:02:46 +00:00
Chris Lattner
d67c632d96 implement the ModuleProvider::dematerializeFunction hook
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37080 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-15 06:29:44 +00:00
Chris Lattner
a9bb713130 Make a preemptive bitcode format change to support PR1146. This lets us do
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-08 05:38:01 +00:00
Chris Lattner
5f32c01dea fix off-by-one that caused the llvm2cpp test to fail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36880 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06 19:27:46 +00:00
Chris Lattner
7108dce324 Allow structs with zero fields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36862 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06 08:21:50 +00:00
Chris Lattner
bfcc38040b add a missing check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36859 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06 07:33:01 +00:00
Jeff Cohen
650c938c41 Keep header file free of 'possible loss of data' warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36832 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06 03:23:14 +00:00
Chris Lattner
2bce93a2ae implement reading/writing of inlineasm objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36827 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06 01:58:20 +00:00
Chris Lattner
cb3d91b05b add a denser encoding for null terminated strings, add a 6-bit abbrev as
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-06 00:53:07 +00:00
Chris Lattner
ff7fc5dabe implement the 'string constant' optimization. This shrinks kc.bit from
2878544 to 2815788


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06 00:35:24 +00:00
Chris Lattner
abfbf85004 further reduce the redundancy of types in the instruction encoding. This
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-06 00:21:25 +00:00
Chris Lattner
7337ab9e92 stop encoding type/value pairs when the type is implied by the value.
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-06 00:00:00 +00:00
Chris Lattner
3f7998054a add support for BLOCKINFO records at the module level. This fixes the reader
issues reid noticed last night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36785 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-05 18:57:30 +00:00
Chris Lattner
e17b658c79 Implement support for globally associating abbrevs with block IDs, which
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-05 00:17:00 +00:00
Chris Lattner
15e6d170e8 eliminate internal length fields from record. Records already know their
total length


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36752 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04 19:11:41 +00:00
Chris Lattner
964b5f2701 storeinst ctor takes isvolatile before alignment. With this, 176.gcc roundtrips
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36738 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04 03:57:30 +00:00
Chris Lattner
35a0470e02 fix a misplaced error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36736 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04 03:50:29 +00:00
Chris Lattner
9113e73ecf encode and read param attrs along with function type. WE can now roundtrip Olden/voronoi loslessly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36735 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04 03:41:34 +00:00
Chris Lattner
48c85b84c1 add support for reading the param attrs block
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36731 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04 03:30:17 +00:00
Chris Lattner
dc78d3a800 remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36728 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04 03:02:54 +00:00
Reid Spencer
c8f8a242e4 Allow this to compile with gcc 4.0.X
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36723 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04 01:43:33 +00:00
Chris Lattner
76520191ab Encoding calling conv info in call/invoke instrs, tree add now round trips completely
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36707 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-03 22:34:03 +00:00
Chris Lattner
c9c55a9d2f the type field for a store is the type of the pointer, not the value.
With this fix I can round trip treeaadd, only losing calling conv info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36706 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-03 22:21:59 +00:00
Chris Lattner
e825ed5a03 fix encoding of BB names in the symtab
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36704 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-03 22:18:21 +00:00
Chris Lattner
f61e6457a5 bug fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36701 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-03 22:09:51 +00:00
Chris Lattner
0579f7f17f implement the rest of the instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36699 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-03 22:04:19 +00:00
Chris Lattner
2a98ccabb4 add a few more instructions, getting close
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36688 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-03 18:58:09 +00:00
Chris Lattner
f4c8e52433 add reader logic for terminator instrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36642 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-02 05:46:45 +00:00