1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 05:23:45 +02:00
Commit Graph

8230 Commits

Author SHA1 Message Date
Reid Spencer
a98ccac6fc Fix some things for Mac OSX archives:
* ensure trailing spaces are eliminated so they don't factor into the
  length of a member's name.
* make sure all the bytes of a name are written even if the name ends in
  multiple null characters (bug in OSX ar)
* make sure we provide the full member name when searching for symbols so
  the module name is not accidentally duplicated.

llvm-svn: 17918
2004-11-17 18:28:29 +00:00
Reid Spencer
3e245bd4d5 Make sure we parse bytecode with a module identifier that reflects the full
name of the module: "Archive.a(object.o)"

llvm-svn: 17917
2004-11-17 18:25:21 +00:00
Chris Lattner
5a2ce1faab Generalize this code to turn any cast-to-first-element-of into a gep constexpr
llvm-svn: 17914
2004-11-17 17:59:35 +00:00
Chris Lattner
bd02c10b87 Simplify conditional and fix LICM/2004-11-17-UndefIndexCrash.ll
by saying what we mean

llvm-svn: 17913
2004-11-17 17:39:39 +00:00
Reid Spencer
b9fbea4c79 Adjust long file name writing to match BSD 4.4 and Mac OSX style archives.
llvm-svn: 17910
2004-11-17 16:14:21 +00:00
Reid Spencer
f59013e0fa Despite documentation to the contrary, Mac OSX and BSD 4.4 archive formats
*do* include the length of the long file in the length of the member and
they are *not* null terminated.

llvm-svn: 17909
2004-11-17 16:13:11 +00:00
Tanya Lattner
18118cf0c3 Added my own defMap. Only saving values that are not loop invariant. Fixed a couple of assertions that were triggered due to registers not being allocated. These both had to do with PHINodes.
llvm-svn: 17907
2004-11-16 21:31:37 +00:00
Chris Lattner
4725ecbbd6 Minor cleanup and speedup. This reduces link-time for 252.eon from 35.5s
to 34.7s with a profile build.

llvm-svn: 17906
2004-11-16 20:39:04 +00:00
Chris Lattner
7fdc458443 Make this function work with non-abstract types.
llvm-svn: 17905
2004-11-16 20:30:53 +00:00
Chris Lattner
8906663505 Don't increment a dead iterator
llvm-svn: 17904
2004-11-16 19:04:40 +00:00
Chris Lattner
a7eec14b04 Fix a major bug in the signed shr code, which apparently only breaks 134.perl!
llvm-svn: 17902
2004-11-16 18:40:52 +00:00
Reid Spencer
24a84793ba * Use low-level unix I/O interface since we're on Unix.
* Don't use variable length arrays (replaced with alloca)

llvm-svn: 17901
2004-11-16 17:14:08 +00:00
Chris Lattner
b40f8214ea Simplify the remapper by only needing one map, since the body of the functions
being linked do not need to be remapped any longer.

llvm-svn: 17900
2004-11-16 17:12:38 +00:00
Chris Lattner
92e712b00f Do not delete dead invoke instructions!
llvm-svn: 17897
2004-11-16 16:32:28 +00:00
Misha Brukman
3885f4ec6d Erase non-applicable Unix comment, this is Win32
llvm-svn: 17896
2004-11-16 07:35:32 +00:00
Brian Gaeke
c68a1fb6b9 Update list of failing benchmarks
llvm-svn: 17895
2004-11-16 07:32:58 +00:00
Brian Gaeke
effc63fac5 Correct the implicit-defs information for indirect and direct calls.
You can't have implicit defs that overlap explicit defs, or implicit
defs that alias one another.

llvm-svn: 17894
2004-11-16 07:32:09 +00:00
Chris Lattner
0493754bcf Take advantage of the fact that we are allowed to clobber the input module
by splicing function bodies from the src module to the destination module.

This speeds up linking quite a bit, e.g. gccld time on 176.gcc from 26s -> 20s
when forming the .rbc file, with a profile build.  One of the really strange
but cool effects of this patch is that it speeds up the optimizers as well,
from 12s -> 10.7s, presumably because of better locality???

In any case, this is just a first step.  We can trivially get rid of the
LocalMap now and do other simplifications.

llvm-svn: 17893
2004-11-16 07:31:51 +00:00
Reid Spencer
35a3e7eacc Fix typeo in comment.
llvm-svn: 17892
2004-11-16 07:05:16 +00:00
Reid Spencer
026d2183e7 Remove useless #include.
Patch contributed by Jeff Cohen.

llvm-svn: 17891
2004-11-16 07:00:23 +00:00
Reid Spencer
0d16952663 Simplify code.
Patch contributed by Jeff Cohen.

llvm-svn: 17890
2004-11-16 06:59:53 +00:00
Reid Spencer
cdc0b6d962 Standardize on 'class' instead of 'struct'. Gets rid of warnings in VC++
Patch contributed by Jeff Cohen.

llvm-svn: 17889
2004-11-16 06:58:55 +00:00
Brian Gaeke
23b56332bc Give a better message for a common assertion failure.
llvm-svn: 17887
2004-11-16 06:52:35 +00:00
Reid Spencer
e64ca0563a Add a comment to some code that at first glance just doesn't look right.
llvm-svn: 17886
2004-11-16 06:50:36 +00:00
Reid Spencer
ddfafa643a Per code review:\
* Adjust indentation\
* Ensure memory do not leak if exceptions happen (std::auto_ptr use)

llvm-svn: 17885
2004-11-16 06:47:41 +00:00
Reid Spencer
2d66bbb7c3 Per code review:\
* Make the numVbrBytes function more efficient and better documented \
* Fix a bug in name truncation \
* Add comments before functions \
* Get rid of functions that are now inlined into the header \
* Do not have Archive doing symbol table printing \
* Put assert comments into the assert so they print out \
* Make sure foreign symbol tables are written

llvm-svn: 17884
2004-11-16 06:47:30 +00:00
Reid Spencer
b6d946d19d Per code review:\
* Make sure we write out the foreign symbol table if we read one \
* Make the padding calculation more efficiently and avoid Solaris warnings

llvm-svn: 17883
2004-11-16 06:47:19 +00:00
Reid Spencer
e39cdbd7f7 Per code review:\
* Make sure all members are initialized upon construction

llvm-svn: 17882
2004-11-16 06:47:07 +00:00
Chris Lattner
be4c91f75f The second arg may be clobbered by this function
llvm-svn: 17880
2004-11-16 06:41:36 +00:00
Reid Spencer
2fe884dad8 Per code review:\
* Get rid of memory leaks on exception \
* Provide better comments of how the memory handling works

llvm-svn: 17876
2004-11-16 06:41:05 +00:00
Chris Lattner
e816a3abc2 use an autoptr
llvm-svn: 17875
2004-11-16 06:40:54 +00:00
Reid Spencer
bcef3fef1d Per code review:
* get rid of (void) construct in function declarations
* make toString a const member
* add a default implementation of toString for Win32

llvm-svn: 17873
2004-11-16 06:22:17 +00:00
Reid Spencer
4031ff44bb Per code review:
* Clean up the StatusInfo constructor to construct all members and give
  them reasonable values.
* Get rid of the Vector typedef and make the interface to
  getDirectoryContent use a std::set instead of a std::vector so the dir
  content is sorted.
* Make the getStatusInfo method const and not return a useless boolean.

llvm-svn: 17872
2004-11-16 06:15:19 +00:00
Reid Spencer
fdf8ac8d29 Per code review:
*Implement/Document the cl::extrahelp feature instead of the MoreHelp ptr.

llvm-svn: 17871
2004-11-16 06:11:52 +00:00
Chris Lattner
c13149e03e Simplify namespaces
llvm-svn: 17870
2004-11-16 04:47:33 +00:00
Chris Lattner
41d31d7461 Remove a dead function, which died when we got GAS emission working (phwew,
hold your nose!)

llvm-svn: 17869
2004-11-16 04:34:29 +00:00
Chris Lattner
b378786c97 Implement a simple FIXME: if we are emitting a basic block address that has
already been emitted, we don't have to remember it and deal with it later,
just emit it directly.

llvm-svn: 17868
2004-11-16 04:30:51 +00:00
Chris Lattner
3f73c77ace * Merge some win32 ifdefs together
* Get rid of "emitMaybePCRelativeValue", either we want to emit a PC relative
  value or not: drop the maybe BS.  As it turns out, the only places where
  the bool was a variable coming in, the bool was a dynamic constant.

llvm-svn: 17867
2004-11-16 04:21:18 +00:00
Chris Lattner
89536fedee Now that we have ghost linkage, we can force resolution of external symbols
immediately instead of lazily.

In this program, for example:

int main() {
  printf("hello world\n");
  printf("hello world\n");
  printf("hello world\n");
  printf("hello world\n");
}

We used to have to go through compilation callback 4 times (once for each
call to printf), now we don't go to it at all.

Thanks to Misha for noticing this, and for adding the initial ghost linkage
patches.

llvm-svn: 17864
2004-11-15 23:20:04 +00:00
Chris Lattner
583ea4764c There is no reason to try to materialize the function from bytecode if it
already has been.  This may be a small speedup.

llvm-svn: 17863
2004-11-15 23:18:09 +00:00
Chris Lattner
3ed3e8669f Add debug-only=jit printout, so we see when lazily resolved symbols are
set up.

llvm-svn: 17862
2004-11-15 23:16:55 +00:00
Chris Lattner
9ef34d44e1 Simplify and rearrange long shift code
llvm-svn: 17861
2004-11-15 23:16:34 +00:00
Chris Lattner
10b5a5c0da Do not emit FunctionBlock blocks for external functions. This shrinks
bytecode files by about 8 bytes per external function

llvm-svn: 17859
2004-11-15 22:39:49 +00:00
Chris Lattner
558ce75905 Use a per-function flag bit to indicate whether or not there is a function
body for the function.

llvm-svn: 17858
2004-11-15 22:38:52 +00:00
Chris Lattner
c199d448e9 Disable this change, it was premature
llvm-svn: 17857
2004-11-15 21:56:33 +00:00
Chris Lattner
704cad0375 Make *SURE* to null out the pointer before throwing an exception, otherwise
the dtor for the BytecodeReader class will try to free it again!

llvm-svn: 17856
2004-11-15 21:55:33 +00:00
Chris Lattner
4a2ae87435 Cleanups. Null out pointer after freeing it for paranoia
llvm-svn: 17855
2004-11-15 21:55:06 +00:00
Chris Lattner
571b490404 If a function is external, do not output a FunctionBlock for the function
AT ALL.  This saves 11 bytes per external function from the bytecode file,
and is also required to make GhostLinkage work.

llvm-svn: 17854
2004-11-15 21:46:40 +00:00
Chris Lattner
d1e621acc6 Make functions default to having external linkage if they have no
FunctionBlock.

llvm-svn: 17853
2004-11-15 21:43:03 +00:00
Misha Brukman
757502af07 Add BCTR and LWZU instruction opcodes
llvm-svn: 17851
2004-11-15 21:20:09 +00:00