1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

720 Commits

Author SHA1 Message Date
Chris Lattner
43553da3a0 Remove obsolete method
llvm-svn: 11302
2004-02-11 01:17:33 +00:00
Chris Lattner
ef4a05f780 Remove the statistics
llvm-svn: 11243
2004-02-09 21:01:23 +00:00
Chris Lattner
6deb7ad03b Speed up type resolution some more. On the testcase in PR224, for example,
this speeds up a release llvm-as from 21.95s to 11.21s, because before it
would do an expensive traversal of the type-graph of every type resolved.

llvm-svn: 11242
2004-02-09 20:23:44 +00:00
Chris Lattner
f7f7d11eac Implement the hashing scheme in an attempt to speed up the "slow" case in
type resolution.  Unfortunately it doesn't help.

Also delete some dead debugging code.

llvm-svn: 11237
2004-02-09 18:32:40 +00:00
Chris Lattner
57a6b877ba Code cleanup in preparation for later changes. Now that ContainedTy's are
consistent across the various type classes, we can factor out a LOT more
almost-identical code.  Also, add a couple of temporary statistics.

llvm-svn: 11232
2004-02-09 16:35:14 +00:00
Chris Lattner
f231cb60f4 Now that all of the derived types have disciplined interfaces, we can eliminate
all of the ad-hoc storage of contained types.  This allows getContainedType to
not be virtual, and allows us to entirely delete the TypeIterator class.

llvm-svn: 11230
2004-02-09 05:40:24 +00:00
Chris Lattner
16690fad3d Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner
a1757d1d91 Start using the new and improve interface to FunctionType arguments
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner
b771939ef3 Two problems with these lines of code:
1. The "work" was not in the assert, so it was punishing the optimized release
 2. getNamedFunction is _very_ expensive in large programs.  It is not designed
    to be used like this, and was taking 7% of the execution time of the code
    generator on perlbmk.

Since the assert "can never fail", I'm just killing it.

llvm-svn: 11214
2004-02-09 00:59:07 +00:00
Chris Lattner
9523c4de75 Fix PR215: [bcwriter] Problem compactifying ConstantPointerRefs
Have I ever mentioned how much I _hate_ constantpointerrefs?

llvm-svn: 11212
2004-02-09 00:15:41 +00:00
Chris Lattner
a9a34f9d82 vi failed me again. :)
llvm-svn: 11206
2004-02-08 21:52:30 +00:00
Chris Lattner
2878b11cfc Rename the invoke 'except' destination to the 'unwind' destination
llvm-svn: 11205
2004-02-08 21:52:04 +00:00
Chris Lattner
68fdb35576 rename the "exceptional" destination of an invoke instruction to the 'unwind' dest
llvm-svn: 11202
2004-02-08 21:44:31 +00:00
Chris Lattner
223ffefd1f Adjust to the new BB ctor
llvm-svn: 11113
2004-02-04 03:57:50 +00:00
Chris Lattner
840109cd9c When splitting a basic block, insert the new half immediately after the first
half.

llvm-svn: 11110
2004-02-04 03:21:31 +00:00
Chris Lattner
7f1e6f16c5 If changing a parent, don't add then remove the object from the leak detector
llvm-svn: 11106
2004-02-04 01:06:38 +00:00
Chris Lattner
1404b61b62 In BasicBlock::splitBasicBlock, just use islist::splice to move the instructions,
instead of a loop that is really inefficient with large basic blocks.

This speeds up the inliner pass on the testcase in PR209 from 13.8s to 2.24s
which still isn't exactly speedy, but is a lot better.  :)

llvm-svn: 11105
2004-02-03 23:11:21 +00:00
Chris Lattner
0e438dc219 Floating point negates are -0.0 - X, not 0.0 - X
llvm-svn: 11084
2004-02-02 20:21:29 +00:00
Chris Lattner
a61cda01c2 Second half of a fix for PR218 & test/Regression/Assembler/2004-02-01-NegativeZero.llx.
Basically we store floating point values as their integral components, instead of relying
on the semantics of floating point < to differentiate between values.  This is likely to
make the map search be faster anyway.

llvm-svn: 11064
2004-02-01 22:49:04 +00:00
Chris Lattner
831561989c Fix a crasher bug in my constant folding rewrite
llvm-svn: 11044
2004-02-01 01:23:19 +00:00
Chris Lattner
317a6fec82 Fix a problem brian ran into with the bytecode reader asserting. It turns
out that the problem was actually the writer writing out a 'null' value
because it didn't normalize it.  This fixes:
test/Regression/Assembler/2004-01-22-FloatNormalization.ll

llvm-svn: 10967
2004-01-23 00:55:21 +00:00
Misha Brukman
87ca68c2ff Let subclasses implement ModuleProvider::materializeModule() which is based on
their implementation of book-keeping for which functions need to be materialized
and which don't.

llvm-svn: 10943
2004-01-21 22:54:50 +00:00
Chris Lattner
781ed02fce SlotCalculator.h moved
llvm-svn: 10931
2004-01-20 19:50:34 +00:00
Chris Lattner
7f7b7be528 Major changes. Now we only compactify individual type planes if it is in
fact "profitable" to do so.  This makes compactification "free" for small
programs (ie, it is completely disabled) and even helps large programs by
not having to encode pointless compactification planes.

On 176.gcc, this saves 50K from the bytecode file, which is, alas only
a couple percent.

This concludes my head bashing against the bytecode format, at least for
now.

llvm-svn: 10922
2004-01-20 00:57:32 +00:00
Chris Lattner
30009bbba7 Add support for building the compactiontable for bytecode files. This shrinks
the bytecode file for 176.gcc by about 200K (10%), and 254.gap by about 167K,
a 25% reduction.  There is still a lot of room for improvement in the encoding
of the compaction table.

llvm-svn: 10913
2004-01-18 21:07:07 +00:00
Chris Lattner
95c8aa8570 Eliminate special case handling for CPR's
Fix some problem cases where I was building the slot calculator in bytecode
writer mode instead of asmwriter mode.

llvm-svn: 10911
2004-01-18 21:03:06 +00:00
Chris Lattner
630c3ddea0 Bytecode format for LLVM 1.2 no longer explicitly encodes zeros in primitive
type planes.  This saves about 5k on 176.gcc, and is needed for a subsequent
patch of mine I'm working on.

llvm-svn: 10908
2004-01-17 23:25:43 +00:00
Chris Lattner
6e293222c3 Cleanups & efficiency improvements
llvm-svn: 10888
2004-01-15 20:24:09 +00:00
Chris Lattner
ba62115c2d The bcwriter does not want ConstantPointerRef's to be indexed, and the asmwriter never did!
llvm-svn: 10885
2004-01-15 18:47:15 +00:00
Chris Lattner
e360d84c48 When emitting bytecode, handle strings specially. Do not add the characters
that make up the strings to the slotcalculator.

llvm-svn: 10862
2004-01-14 23:34:39 +00:00
Chris Lattner
c33ebd6588 Hrm, apparently I missed lowering this intrinsic. :(
llvm-svn: 10858
2004-01-14 20:41:29 +00:00
Chris Lattner
8767bd75e4 Fix bug in previous checkin: Demorgan would be ashamed of me, I need to
lay off the crack.

llvm-svn: 10855
2004-01-14 17:51:53 +00:00
Chris Lattner
a991025919 Implement ConstantArray::isString
llvm-svn: 10851
2004-01-14 17:06:38 +00:00
Chris Lattner
13a3f4eaeb Fix check. PHI nodes must be handled specially, of course.
llvm-svn: 10842
2004-01-14 05:42:52 +00:00
Chris Lattner
e12d9fd9a7 Tighten up verifier checks. The result of an invoke instruction only
dominates the normal destination, not the exceptional dest (ie, the result
of a call is undefined on an exception)

llvm-svn: 10841
2004-01-14 04:25:59 +00:00
Chris Lattner
bcd7372d19 The only clients of the slot calculator are now the asmwriter and bcwriter.
Since this really only makes sense for these two, change hte instance variable
to reflect whether we are writing a bytecode file or not.  This makes it
reasonable to add bcwriter specific stuff to it as necessary.

llvm-svn: 10837
2004-01-14 02:49:34 +00:00
Chris Lattner
807e401607 Implement a bunch of symbolic constant folding opportunities. This implements
testcase test/Regression/Assembler/ConstantExprFold.llx

Note that these kinds of things only rarely show up in source code, but are
exceedingly common in the intermediate stages of algorithms like SCCP.  By
folding things (especially relational operators) that use symbolic constants,
we are able to speculatively fold more conditional branches, which can
lead to some big simplifications.

It would be easy to add a lot more special cases here, so if you notice
SCCP missing anything "obvious", you know what to make smarter.  :)

llvm-svn: 10812
2004-01-13 05:51:55 +00:00
Chris Lattner
4ec6589a6e Implement new Instruction::isRelational method
llvm-svn: 10810
2004-01-12 23:18:25 +00:00
Chris Lattner
3e9e5b7db4 Rearrange and comment code better. No functionality changes
llvm-svn: 10808
2004-01-12 22:07:24 +00:00
Chris Lattner
b4e121c364 Rename ConstantHandling.* -> ConstantFolding.*
Move a bunch of (now) private stuff from ConstantFolding.h into
ConstantFolding.cpp.

This _finally_ gets us to a place where we have a sane constant folder.  The
rules are:

1. LLVM clients now use ConstantExpr::get* methods to fold constants.  If they
   cannot be folded, a constantexpr is created, so these methods always return
   valid Constant*'s.
2. The implementation of ConstantExpr::get* uses the functions exposed by
   ConstantFolding.h to try to fold constants.  If they cannot be folded,
   they should return a null pointer.
3. The implementation of ConstantFolding can do whatever it wants, and only
   has one client (Constants.cpp)

This cuts down on the wierd dependencies, and eliminates the two interfaces.
The old constanthandling interface was especially bad for clients to use
because almost none of them took the failure condition into consideration,
thus leading to obscure problems.

llvm-svn: 10807
2004-01-12 21:13:12 +00:00
Chris Lattner
7285258cc0 Remove a whole bunch more ugliness. This is actually getting to the point of
this whole refactoring: allow constant folding methods to return something
other than predefined classes, allow them to return generic Constant*'s.

llvm-svn: 10806
2004-01-12 21:02:29 +00:00
Chris Lattner
d757923e11 Move ConstantHandling.h into lib/VMCore and out of include/llvm
llvm-svn: 10805
2004-01-12 20:48:11 +00:00
Chris Lattner
f6f9aafee4 Move this file to lib/VMCore
llvm-svn: 10804
2004-01-12 20:47:29 +00:00
Chris Lattner
abdd592bb1 Eliminate usage of the wierd overloaded operator constant folders
llvm-svn: 10802
2004-01-12 20:41:05 +00:00
Chris Lattner
b420886171 Eliminate ConstantFoldShiftInstruction reference
llvm-svn: 10801
2004-01-12 20:40:42 +00:00
Chris Lattner
35771f4fd2 Fix out of date comment, remove use of ConstantExpr::getShift
llvm-svn: 10794
2004-01-12 19:12:58 +00:00
Chris Lattner
52759f5c5e Make ConstantExpr::get work for shifts as well
llvm-svn: 10790
2004-01-12 19:04:55 +00:00
Chris Lattner
e6b9c1001b Move llvm::ConstantFoldInstruction from here to Transforms/Utils
llvm-svn: 10784
2004-01-12 18:25:03 +00:00
Chris Lattner
a4f199b80c Implement: Assembler/2004-01-11-getelementptrfolding.llx
llvm-svn: 10759
2004-01-11 23:56:33 +00:00
Chris Lattner
1e781891a5 Urg, remove testing code.
llvm-svn: 10757
2004-01-11 23:30:03 +00:00