Commit Graph

5428 Commits

Author SHA1 Message Date
Chris Lattner
c1df7e1799 Two changes:
1. Don't scan to the end of alloca instructions in the caller function to
     insert inlined allocas, just insert at the top.  This saves a lot of
     time inlining into functions with a lot of allocas.
  2. Use splice to move the alloca instructions over, instead of remove/insert.
     This allows us to transfer a block at a time, and eliminates a bunch of
     silly symbol table manipulations.

This speeds up the inliner on the testcase in PR209 from 1.73s -> 1.04s (67%)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11118 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 21:33:42 +00:00
Alkis Evlogimenos
f0339396c1 IMULri* instructions do not require their first two registers operands
to be the same (IOW they are not two address instructions).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11117 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 17:21:04 +00:00
Chris Lattner
44a6807f4f Optimize the case where we are inlining a function that contains only one basic block,
and that basic block ends with a return instruction.  In this case, we can just splice
the cloned "body" of the function directly into the source basic block, avoiding a lot
of rearrangement and splitBasicBlock's linear scan over the split block.  This speeds up
the inliner on the testcase in PR209 from 2.3s to 1.7s, a 35% reduction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11116 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 04:17:06 +00:00
Chris Lattner
c24a076c6a Adjust to the new BasicBlock ctor, which requires a function parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11114 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 03:58:28 +00:00
Chris Lattner
4f05611ed9 Adjust to the new BB ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11113 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 03:57:50 +00:00
Chris Lattner
3b332fd376 Remove unneeded code now that splitBasicBlock does the "right thing"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11111 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 03:21:51 +00:00
Chris Lattner
c6aa017eae When splitting a basic block, insert the new half immediately after the first
half.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11110 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 03:21:31 +00:00
Chris Lattner
5e923dee60 More refactoring. Move alloca instructions and handle invoke instructions
before we delete the original call site, allowing slight simplifications of
code, but nothing exciting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11109 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 02:51:48 +00:00
Chris Lattner
5052c911ec Move the cloning of the function body much earlier in the inlinefunction
process.  The only optimization we did so far is to avoid creating a
PHI node, then immediately destroying it in the common case where the
callee has one return statement.  Instead, we just don't create the return
value.  This has no noticable performance impact, but paves the way for
future improvements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11108 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 01:41:09 +00:00
Chris Lattner
23b4c68f46 Give CloneBasicBlock an optional function argument to specify which function
to add the cloned block to.  This allows the block to be added to the function
immediately, and all of the instructions to be immediately added to the function
symbol table, which speeds up the inliner from 3.7 -> 3.38s on the PR209.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11107 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 01:19:43 +00:00
Chris Lattner
786993c01e If changing a parent, don't add then remove the object from the leak detector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11106 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-04 01:06:38 +00:00
Chris Lattner
f2c3106866 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.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11105 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 23:11:21 +00:00
Chris Lattner
e47f78ed12 Bunch up all locally used allocas by the block they are allocated in, and
process them all as a group.  This speeds up SRoA/mem2reg from 28.46s to
0.62s on the testcase from PR209.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11100 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 22:34:12 +00:00
Chris Lattner
7fecc2e5e2 Handle extremely trivial cases extremely efficiently. This speeds up
SRoA/mem2reg from 41.2s to 27.5s on the testcase in PR209.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11099 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 22:00:33 +00:00
Chris Lattner
9f08a92e6c Generate ftst instructions for comparison against zero
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11098 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 18:54:04 +00:00
Chris Lattner
3b904eb351 Add the ftst instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11095 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 07:27:50 +00:00
Chris Lattner
b97046ae4f Add support for one argument OneArgFP instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11094 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 07:27:34 +00:00
Alkis Evlogimenos
4e7854407c When an instruction like: A += B had both A and B virtual registers
spilled, A was loaded from its stack location twice. This fixes the bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11093 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-03 01:13:07 +00:00
Alkis Evlogimenos
9fe7602862 Revert changes. Will implement this using a different set of primitives
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11091 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 23:08:58 +00:00
Alkis Evlogimenos
cc6a1290fc Fix debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11088 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 22:00:32 +00:00
Alkis Evlogimenos
eea81bafd6 Correctly update def/use information for modified machine operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11087 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 21:56:40 +00:00
Alkis Evlogimenos
b606eaca1b Should be more careful. The previously applied change made all counts
outside of loops = 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11085 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 20:29:57 +00:00
Chris Lattner
84a102a780 Floating point negates are -0.0 - X, not 0.0 - X
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11084 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 20:21:29 +00:00
Chris Lattner
0517e72096 Disable (x - (y - z)) => (x + (z - y)) optimization for floating point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11083 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 20:09:56 +00:00
Chris Lattner
529429224c Update comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11082 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 20:09:22 +00:00
Chris Lattner
1580193020 No need to declare implicit uses/defs of ST0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11081 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 19:57:45 +00:00
Brian Gaeke
09ca4115ee Make deadarghaX0r warning louder.
(I just love typing haX0r.   haX0r haX0r haX0r.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11079 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 19:32:27 +00:00
Chris Lattner
9f8fd6d9ea Generate the fchs instruction to negate a floating point number
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11078 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 19:31:38 +00:00
Chris Lattner
4a06f35484 Add support for OneArgFPRW instructions, fix a couple of typeos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11077 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 19:23:15 +00:00
Brian Gaeke
03f84a969c Include PowerPC.h. Flesh out the stub versions of addPassesToEmitAssembly()
and addPassesToJITCompile() slightly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11076 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 19:06:36 +00:00
Brian Gaeke
b77232d1fc Add comments describing how you would add prototypes for factory methods for
PowerPC-specific passes here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11073 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 19:05:28 +00:00
Chris Lattner
af70362e40 Codegen -0.0 correctly. Do not use fldz! This is another -0.0 == +0.0 problem, arg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11070 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 18:56:30 +00:00
Alkis Evlogimenos
22b7e44bb0 Create an object for tracking physical register usage. This will look
much better when I get rid of the reserved registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11066 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-02 07:30:36 +00:00
Chris Lattner
cfdf2419bc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11064 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 22:49:04 +00:00
Alkis Evlogimenos
04667297af Change weight array into a vector and make it as big as the number of
registers (not as the max number of registers).

Change toSpill from a std::set into a std::vector<bool>.

Use the reverse iterator adapter to do a reverse scan of allocatable
registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11061 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 20:13:26 +00:00
Alkis Evlogimenos
f440cc19c9 Use std::map::count() instead of std::map::find() != std::map::end()
where appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11060 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 18:39:53 +00:00
Alkis Evlogimenos
b180e3e92b Change string for joined intervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11057 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 16:13:05 +00:00
Alkis Evlogimenos
a1b6f95f78 FpMOV is also a move instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11055 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 08:22:16 +00:00
Alkis Evlogimenos
b0b0ebaac0 Change xor to ^.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11054 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 08:19:25 +00:00
Chris Lattner
c23396e8de Disable tail duplication in any "hard" cases, where it might break SSA form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11052 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 06:32:28 +00:00
Chris Lattner
d4baf0f74c Fix a bug in a recent checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11050 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 05:25:07 +00:00
Chris Lattner
e400a0976f Fix the count of the number of instructions removed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11049 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 05:15:07 +00:00
Alkis Evlogimenos
676cf8cb1d Missed one silly assert :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11048 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 02:21:31 +00:00
Alkis Evlogimenos
01e74a2aab Simplify joinIntervals() code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11047 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 02:18:31 +00:00
Chris Lattner
fff663b47a Remove all of the annoying statistics now that I'm finished (for the near
term) working on bytecode size stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11046 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 01:50:31 +00:00
Alkis Evlogimenos
4f67b86648 Use MRegisterInfo::isPhysicalRegister and
MRegisterInfo::isVirtualRegister.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11045 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 01:27:01 +00:00
Chris Lattner
b97e2788ff Fix a crasher bug in my constant folding rewrite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11044 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 01:23:19 +00:00
Chris Lattner
338733fdd2 Print an error message if we can't materialize the bytecode file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11043 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 01:07:25 +00:00
Chris Lattner
da79bd2322 Print an error message if there is an error materialize the bc file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11041 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 00:32:35 +00:00
Alkis Evlogimenos
52220f61bb Apply final part of Chris' patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11040 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 23:48:47 +00:00
Alkis Evlogimenos
02ba13c989 Be a little smarter on the way we handle physical register defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11038 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 23:13:30 +00:00
Chris Lattner
ef09c63e7b Finegrainify namespacification, use new MRegisterInfo::isVirtualRegister
method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11037 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 21:27:19 +00:00
Chris Lattner
6b50767905 Fix, correctly this time, the computation of the return value
Fix a spello
Tighten up the assertion checking

No functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11036 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 21:21:43 +00:00
Chris Lattner
163c1e7a69 * Fix incorrect computation of the runOnMachineFunction return value
* Turn a bunch of instance variables into automatic variables


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11035 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 21:14:04 +00:00
Chris Lattner
bd91c1c376 Remove unneeded #includes
Move Passes.h (which defines the interface to this file) to the top.
Move statistics to the top of the file.
Add a comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11034 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 21:07:15 +00:00
Chris Lattner
a67138ddff Avoid referencing deleted DSgraphs when merging an SCC into a larger SCC. This
fixes the crash in 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11033 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 21:02:18 +00:00
Alkis Evlogimenos
08cec00588 Merge safe parts from last night's buggy commit. These do not break
any test cases :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11032 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 19:59:32 +00:00
Alkis Evlogimenos
97017de187 Optimize liveAt() and overlaps(). We now use a binary search instead
of a linear search to find the first range for comparisons. This cuts
down the linear scan register allocator running time by a factor of 3
in 254.perlbmk and by a factor of 2.2 in 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11030 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 16:54:54 +00:00
Alkis Evlogimenos
4d46e1e521 Revert last night's changes as they broke some tests. Will remerge parts of the patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11029 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 14:37:41 +00:00
Alkis Evlogimenos
32bdd4ea65 Several performance enhancements and cleanups from Chris.
Simplification of LiveIntervals::Interval::overlaps() and addition of
examples to overlaps() and liveAt() to make them clearer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11028 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 04:56:07 +00:00
Chris Lattner
a4dd6743e7 Fix thinko
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11027 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-30 22:48:02 +00:00
Chris Lattner
847df25e7d Add some comments sketching out how this is to work eventually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11026 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-30 22:25:18 +00:00
Chris Lattner
79b13735ad Add a new flag, which is only used for symmetry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11025 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-30 22:24:18 +00:00
Chris Lattner
92e41d5982 Forward method request to chained aa implementation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11024 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-30 22:20:55 +00:00
Chris Lattner
bc1daaa8bb Implement the pointsToConstantMemory() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11022 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-30 22:17:24 +00:00
Chris Lattner
f4d904d7e3 Improve mod/ref information based on the pointsToConstantMemory method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11021 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-30 22:16:42 +00:00
Chris Lattner
cf93cdde56 Add (currently disabled) support to the instruction selector to only insert
FP_REG_KILL instructions at the end of blocks involved with critical edges.

Fix a bug where FP_REG_KILL instructions weren't inserted in fall through
unconditional branches.  Perhaps this will fix some linscan problems?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11019 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-30 22:13:44 +00:00
Chris Lattner
49a5aaacef Finegrainify namespacification
Implement LiveVariables::getIndexMachineBasicBlock


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11018 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-30 22:08:53 +00:00
Brian Gaeke
09caa3751f Give clients of MachineFunctionPrinter the ability to specify a banner and
choose an ostream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11016 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-30 21:53:46 +00:00
Misha Brukman
10d208d7b1 Order #includes alphabetically, per style guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11015 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-30 17:26:24 +00:00
Chris Lattner
ead9eb75d7 Fix a bug aflicting 265.gap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11006 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-29 08:36:22 +00:00
Chris Lattner
17a93e2e1b Minor bugfixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11005 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-29 03:32:15 +00:00
Misha Brukman
7c791ed0a4 Hyphenate `target-dependent'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11003 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 20:43:01 +00:00
Brian Gaeke
97374d40d0 Add a new (static inline) std::ostream& << AllocInfo& method. Use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11002 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 19:05:43 +00:00
Chris Lattner
62482e5649 Rename DSGraph::ScalarMapTy -> DSScalarMap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11001 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 09:15:42 +00:00
Chris Lattner
28da03b0fe Fix a bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11000 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 03:31:34 +00:00
Chris Lattner
a3fd88d01f Eliminate the call to removeTriviallyDeadNodes from updateFromGlobals graph,
moving it to the start of removeDeadNodes.  This speeds up DSA by 2s on perlbmk
from 41s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10999 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 03:24:41 +00:00
Chris Lattner
6d8f3dcd75 In the TD pass, iterate over globals directly instead of through the whole scalar
map.  This saves 5s in the TD pass, from 22->17s on perlbmk


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10998 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 03:12:48 +00:00
Chris Lattner
34741cf0dd In the TD pass, don't iterate over the scalar map to find the globals, iterate over
the globals directly.  This doesn't save any substantial time, however, because the
globals graph only contains globals!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10997 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 03:07:30 +00:00
Chris Lattner
bdce7b7844 In updateFromGlobalsGraph, instead of iterating over all of the scalars in the
function to find the globals, iterate over all of the globals directly.  This
speeds the function up from 14s to 6.3s on perlbmk, reducing DSA time from
53->46s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10996 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 03:03:06 +00:00
Chris Lattner
a88a55cf10 Minor tweaks, eliminate useless integer pruning optimziation, turn on
timers by default


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10993 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 02:41:32 +00:00
Chris Lattner
239644dc3b Further reduce the number of nodes cloned with getClonedNH, using merge instead.
This reduces the number of nodes allocated, then immediately merged and DNE'd
from 2193852 to 1298049.  unfortunately this only speeds DSA up by ~1.5s (of
53s), because it's spending most of its time waddling through the scalar map :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10992 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 02:11:49 +00:00
Chris Lattner
00948c05b2 Add a timer, fix a minor bug.
Also, use RC::merge when possible, reducing the number of nodes allocated, then immediately merged away from 2985444 to 2193852 on perlbmk.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10991 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 02:05:05 +00:00
Chris Lattner
64507e39da Another bugfix, disable "spurious" output.
You gotta love spurious


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10990 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 01:19:52 +00:00
Chris Lattner
352e31f572 fix bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10989 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-27 22:54:56 +00:00
Chris Lattner
0b14487591 * Add a new commandline argument to control the "global roots hack". Default
it to be off.  If it looks like it's completely unnecessary after testing, I
  will remove it completely (which is the hope).
* Callers of the DSNode "copy ctor" can not choose to not copy links.
* Make node collapsing not create a garbage node in some cases, avoiding a
  memory allocation, and a subsequent DNE.
* When merging types, allow two functions of different types to be merged
  without collapsing.
* Use DSNodeHandle::isNull more often instead of DSNodeHandle::getNode() == 0,
  as it is much more efficient.
*** Implement the new, more efficient reachability cloner class
    In addition to only cloning nodes that are reachable from interesting
    roots, this also fixes the huge inefficiency we had where we cloned lots
    of nodes, only to merge them away immediately after they were cloned.
    Now we only actually allocate a node if there isn't one to merge it into.
* Eliminate the now-obsolete cloneReachable* and clonePartiallyInto methods
* Rewrite updateFromGlobalsGraph to use the reachability cloner
* Rewrite mergeInGraph to use the reachability cloner
* Disable the scalar map scanning code in removeTriviallyDeadNodes.  In large
  SCC's, this is extremely expensive.  We need a better data structure for the
  scalar map, because we really want to scan the unique node handles, not ALL
  of the scalars.
* Remove the incorrect SANER_CODE_FOR_CHECKING_IF_ALL_REFERRERS_ARE_FROM_SCALARMAP code.
* Move the code for eliminating integer nodes from the trivially dead
  eliminator to the dead node eliminator.
* removeDeadNodes no longer uses removeTriviallyDeadNodes, as it contains a
  superset of the node removal power.
* Only futz around with the globals graph in removeDeadNodes if it is modified


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10987 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-27 22:03:40 +00:00
Chris Lattner
f325e3981e Rewrite to use the reachability cloner interface. Also, make this much more
efficient in the case where a function calls into the same graph multiple times
(ie, it either contains multiple calls to the same function, or multiple calls
to functions in the same SCC graph)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10986 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-27 21:53:14 +00:00
Chris Lattner
02da032b03 minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10985 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-27 21:51:19 +00:00
Chris Lattner
825a02ae36 Get clone flags right, so we don't build InlinedGlobals only to clear them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10984 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-27 21:50:41 +00:00
John Criswell
7f7d16b62f Fixes for PR214. Use the SHLIBEXT variable instead of hardcoding .so into
every file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10976 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-26 20:59:41 +00:00
Alkis Evlogimenos
79b0c3f0b9 Fix failing test cases with joined live intervals. It turns out that
when joining we need to check if we overlap with the second interval
or any of its aliases.

Also make joining intervals the default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10973 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-23 13:37:51 +00:00
Brian Gaeke
954e3164be Add the JITInfo object, accessor & initializer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10972 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-23 06:39:30 +00:00
Brian Gaeke
7b0cd6d6cb Add CodeEmitter and JITInfo stubs. Dump the old
PowerPCTargetMachine::addPassesToJITCompile() method, in favor of the
TargetJITInfo interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10971 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-23 06:35:43 +00:00
Chris Lattner
091f776081 Initial support for implementing clonePartiallyInto in terms of cloneReachableSubgraph, though this support is currently disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10970 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-23 01:44:53 +00:00
Chris Lattner
90fb19ed2c 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10967 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-23 00:55:21 +00:00
Alkis Evlogimenos
e88280a422 Add option to join live intervals. Two intervals are joined if there
is a move between two registers, at least one of the registers is
virtual and the two live intervals do not overlap.

This results in about 40% reduction in intervals, 30% decrease in the
register allocators running time and a 20% increase in peephole
optimizations (mainly move eliminations).

The option can be enabled by passing -join-liveintervals where
appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10965 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 23:08:45 +00:00
Alkis Evlogimenos
84dc5fb6ba Remove unneeded check. An interval in active, by definition overlaps
with the current one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10959 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 20:07:18 +00:00
Alkis Evlogimenos
ce50115006 Improve debugging output. Remove unneeded virtReg->0 mapping when
virtReg lives on the stack. Now a virtual register has an entry in the
virtual->physical map or the virtual->stack slot map but never in
both.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10958 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 19:24:43 +00:00
Alkis Evlogimenos
1075ecd32f Revert previous change. The code was correct...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10957 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 19:17:52 +00:00
Alkis Evlogimenos
e1a210777d Fix incorrect negatives in LiveIntervals::Interval::liveAt().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10956 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 18:33:50 +00:00
Chris Lattner
2f561384fb Eliminated the CompletedNodes argument to the cloneReachable* methods. This
map was only used to implement a marginal GlobalsGraph optimization, and it
actually slows the analysis down (due to the overhead of keeping it), so just
eliminate it entirely.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10955 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 16:56:13 +00:00
Chris Lattner
93ddd7ea10 Ok, I'm tired of pulling out all my timers to check stuff in, just do it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10954 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 16:36:28 +00:00
Chris Lattner
5254a8dda8 Bug fix: X.mergeWith(Y) was not updating Y if Y was a null node handle!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10953 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 16:31:08 +00:00
Chris Lattner
4c6cb7a2b1 Start implementing DSGraph::clonePartiallyInto and implement mergeInGraph
in terms of it.

Though clonePartiallyInto is not cloning partial graphs yet, this change
dramatically speeds up inlining of graphs with many scalars.  For example,
this change speeds up the BU pass on 253.perlbmk from 69s to 36s, because
it avoids iteration over the scalar map, which can get pretty large.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10951 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 15:30:58 +00:00
Chris Lattner
4a85776993 Allow disabling of ALL printing overhead when performing timings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10948 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 13:42:43 +00:00
Misha Brukman
afca90e832 Implement ModuleProvider::materializeModule() by only materializing functions
that are still left in the lazy reader map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10944 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-21 22:55:34 +00:00
Misha Brukman
ce218c6492 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10943 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-21 22:54:50 +00:00
Brian Gaeke
b1b9dc35a7 Build the PowerPC directory, so it is less likely to bit-rot (again)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10938 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-21 21:16:10 +00:00
Brian Gaeke
ca78f49234 Import of skeletal PowerPC backend I have had laying around for months...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10937 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-21 21:13:19 +00:00
Chris Lattner
f2d577b27a SlotCalculator.h moved
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10931 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 19:50:34 +00:00
Chris Lattner
db9b998f63 Move SlotCalculator.h from include/llvm to include/llvm/Analysis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10930 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 19:50:12 +00:00
Chris Lattner
62f8bf0566 Fix PR212 - Bytecode reader misreads 'long -9223372036854775808'!
Fix testcase test/Regression/Assembler/2004-01-20-MaxLongLong.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10928 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 19:13:07 +00:00
Tanya Lattner
06723077ed Moved iterators around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10926 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 17:51:13 +00:00
Tanya Lattner
a105c802b2 Moved iterators to common file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10925 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 17:49:42 +00:00
Chris Lattner
cdaff32ef6 Fix bogus warning and simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10924 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 17:06:29 +00:00
Chris Lattner
68e3dbc493 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10922 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 00:57:32 +00:00
Chris Lattner
a2b4f93a1b add a method proto, make a method not inline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10921 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 00:54:47 +00:00
Chris Lattner
52f86d6247 Bugfixes for dealing with partially compactified functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10920 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 00:54:06 +00:00
Chris Lattner
241024381f Save another 30K from 176.gcc by encoding the compaction table a bit more
intelligently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10918 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 22:35:34 +00:00
Chris Lattner
33522d4f25 Remove -debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10917 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 22:26:53 +00:00
Chris Lattner
cf3e67f70a Add support for writing bytecode files with compactiontables 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10915 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 21:08:52 +00:00
Chris Lattner
89e025387e Add support for reading bytecode files with compactiontables 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10914 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 21:08:15 +00:00
Chris Lattner
614cdcd002 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10913 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 21:07:07 +00:00
Chris Lattner
af894e963b Add support for representing the "compaction table"
Change protected members to private.  Nothing should subclass SlotCalculator


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10912 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 21:03:49 +00:00
Chris Lattner
2ff95b6b4e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10911 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 21:03:06 +00:00
Chris Lattner
80b97343ec 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10908 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-17 23:25:43 +00:00
Chris Lattner
64811a3e18 This file goes away
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10905 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-17 19:35:57 +00:00
Alkis Evlogimenos
a12c7bb06f Handle printing of intervals that are not assign to any physical
register yet (2nd try).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10896 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-16 20:33:13 +00:00
Alkis Evlogimenos
a6d8c3f845 Handle printing of intervals that are not assign to any physical
register yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10895 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-16 20:29:42 +00:00
Alkis Evlogimenos
3b02cbe752 Fold open interval ends handling into
LiveIntervals::Interval::expiredAt() and simplify regalloc code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10894 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-16 20:17:05 +00:00
Alkis Evlogimenos
1893a05b28 Add asserts to previous change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10893 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-16 16:23:23 +00:00
Alkis Evlogimenos
f5f1689ed2 Use a list instead of a vector to store intervals. This will be needed
when we join intervals and one of the two will need to be removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10892 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-16 16:06:59 +00:00
Misha Brukman
cbbbdf768f Use the LLVM standard name mangling infrastructure instead of reinventing the
wheel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10891 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 22:44:19 +00:00
Chris Lattner
0baa0af861 If these blocks are empty, there is no reason to even emit the bytecode blocks.
This saves about 15K in 176.gcc, coupled with another patch that I'm working on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10889 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 21:06:57 +00:00
Chris Lattner
d5c59d5c84 Cleanups & efficiency improvements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10888 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 20:24:09 +00:00
Chris Lattner
8c202cdbda The bcwriter does not want ConstantPointerRef's to be indexed, and the asmwriter never did!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10885 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:47:15 +00:00
Chris Lattner
7be08bfae1 ConstantPointerRef's are no longer emitted. This saves 20028 bytes in the
bytecode files when compiling 176.gcc, but more importantly will make it
easier to eliminate CPR's in the future (no new .bc revision will be
required to support them)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10884 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:46:56 +00:00
Chris Lattner
933619912b Allow bytecode files to refer directly to global values as constants, instead
of forcing them to go through ConstantPointerRef's.  This allows bytecode
files to mirror .ll files, allows more efficient encoding, and makes it easier
to eventually eliminate CPR's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10883 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:45:25 +00:00
Chris Lattner
ff47e7d02e Fix more breakage with string change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10882 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:39:06 +00:00
Brian Gaeke
d011a027e0 Include TargetRegInfo.h and declare SparcTargetMachine forward, to make this
header more easily includable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10880 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:17:07 +00:00
Brian Gaeke
0f5918a0b6 Make this assertion more self-explanatory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10879 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:15:58 +00:00
Chris Lattner
f4c0e7f587 Fix PR73: bytecode format inconsistent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10876 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 17:55:09 +00:00
Chris Lattner
44d0eebc13 Fix PR73
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10875 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 17:55:01 +00:00
Chris Lattner
570fb1cbd8 Fix brokenness in my last checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10874 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 16:56:15 +00:00
Chris Lattner
7969dc2bec Change all of the bytecode reader primitives to throw exceptions instead of
returning error codes.  Because they don't return an error code, they can
return the value read, which simplifies the code and makes the reader more
efficient (yaay!).

Also eliminate the special case code for little endian machines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10871 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 06:13:09 +00:00
Chris Lattner
c8434e3d71 Remove the optimization that depends on ENDIAN_LITTLE: it's not worth it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10870 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 06:11:30 +00:00
Chris Lattner
7851e1b328 Improve comments, add support for remembering the constants strings that
are to be emitted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10866 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:37:43 +00:00
Chris Lattner
83bb3d2f4e The new bytecode format supports emitting strings a special case. This is
intended to save size (and does on small programs), but on big programs it
actually increases the size of the program slightly.  The deal is that many
functions end up using the characters that the string contained, and the
characters are no longer in the global constant table, so they have to be
emitted in function specific constant pools.

This pessimization will be fixed in subsequent patches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10864 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:36:54 +00:00
Chris Lattner
9e893e8a3d Version 1.2 now supports encoding strings as a special case, to avoid having
to emit all of those sbyte constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10863 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:35:21 +00:00
Chris Lattner
dcea63026f When emitting bytecode, handle strings specially. Do not add the characters
that make up the strings to the slotcalculator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10862 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:34:39 +00:00
Chris Lattner
4e8683664d Like output_data, it's obvious that input_data was only used with 1 character
data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10861 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:03:22 +00:00
Chris Lattner
411a9a6f07 "fix" a nasty race condition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10860 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 21:18:03 +00:00
Chris Lattner
de31b76784 Fix some exception safety problems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10859 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 20:58:17 +00:00
Chris Lattner
f907bac068 Hrm, apparently I missed lowering this intrinsic. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10858 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 20:41:29 +00:00
Chris Lattner
0a3a27b0ae It is obvious that this has never been used for outputing more than a single
byte, it's totally endian incorrect!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10857 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 18:50:28 +00:00
Chris Lattner
44e38034d5 Be const correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10856 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 18:41:38 +00:00
Chris Lattner
7aa162b29b Fix bug in previous checkin: Demorgan would be ashamed of me, I need to
lay off the crack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10855 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 17:51:53 +00:00
Chris Lattner
07ad64231f Eliminate the isStringCompatible function, using ConstantArray::isString.
It's not clear why the code was looking for signed chars < 0, but it can't
matter to the assembler anyway, so the check goes away.  This also fixes
compatibility with arrays of [us]byte that have constantexprs in them.

Also slightly restructure some code to be cleaner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10854 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 17:15:17 +00:00
Chris Lattner
aa06d0439e Eliminate the isStringCompatible function, using ConstantArray::isString.
It's not clear why the code was looking for signed chars < 0, but it can't
matter to the assembler anyway, so the check goes away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10853 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 17:14:42 +00:00
Chris Lattner
e3f84f53ca Use new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10852 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 17:07:46 +00:00
Chris Lattner
13cfdea1ef Implement ConstantArray::isString
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10851 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 17:06:38 +00:00
Chris Lattner
d6942d7633 Ok, I can't handle it. This is a temporary checkin of a ton of statistics that
i'm using in my work to reduce the bytecode file sizes.  These will eventually
be removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10849 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 16:54:21 +00:00
Chris Lattner
c08912f917 Remove support for the pre-1.0 bytecode version #1. This will become
the bytecode revision generated by LLVM 1.2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10848 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 16:44:44 +00:00
Alkis Evlogimenos
d6e40a6cbc Properly update #intervals statistic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10847 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 10:44:29 +00:00
Chris Lattner
f78616b339 Fix InstCombine/2004-01-13-InstCombineInvokePHI.ll, which also fixes lots
of C++ programs in Shootout-C++, including lists1 and moments, etc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10845 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 06:06:08 +00:00
Brian Gaeke
34562bab04 Don't pass anything to the IntrinsicLowering class that is not_intrinsic,
because that makes it abort. Also, fix a typo in a comment.

This checkin brought to you by the "It only takes about 30 seconds to run
ENABLE_LLI tests on Shootout on zion, even if they all dump core" fund.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10844 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 06:02:53 +00:00
Chris Lattner
c9b0702a89 Fix check. PHI nodes must be handled specially, of course.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10842 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 05:42:52 +00:00
Chris Lattner
30768ac3c2 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10841 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 04:25:59 +00:00
Chris Lattner
277bafbff7 Toggle sense of flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10838 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 02:50:16 +00:00
Chris Lattner
8ce750145d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10837 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 02:49:34 +00:00
Alkis Evlogimenos
9739736b94 Fix bug in LiveIntervals::Interval::overlaps and
LiveIntervals::Interval::liveAt. Both were considering the live ranges
closed in the end, when they are actually open.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10835 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 00:20:09 +00:00
Alkis Evlogimenos
5ab20273a4 Improve debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10834 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 00:09:36 +00:00
Alkis Evlogimenos
af25473d5e Fix miscomputation of live intervals. The catch is that registers can
be dead at the defining instruction but can only be killed in
subsequent ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10833 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 22:26:14 +00:00
Alkis Evlogimenos
1a119e2410 Remove allocatable registers vector. It is already provided by
LiveVariables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10830 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 22:10:43 +00:00
Alkis Evlogimenos
a3a6524965 Cleanup debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10824 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 21:53:20 +00:00
Chris Lattner
7446dc0c4f Finegrainify namespacification
Using the SlotCalculator is total overkill for this file, a simple map
will suffice.  Why doesn't this use the NameMangler interface?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10823 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 21:27:59 +00:00
Alkis Evlogimenos
63841bc85d Fix output of live intervals to show correctly its closed, open
ranges, i.e. [a,b)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10822 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 21:17:47 +00:00
Alkis Evlogimenos
c55640f019 Remove unneeded check (with the recent change in live variables a use
of a physical register is always dominated by a def).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10821 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 21:16:25 +00:00
Alkis Evlogimenos
b7be115140 Indentation and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10820 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 20:42:08 +00:00
Alkis Evlogimenos
f7df173e3b Fix bug introduced by previous commit: check if fixed intervals
overlap before adding their spill weight.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10819 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 20:37:01 +00:00
Brian Gaeke
f954326741 Remove dump-input option.
Make addPassesToEmitAssembly() look slightly more like addPassesToJITCompile().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10818 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 19:26:21 +00:00
Alkis Evlogimenos
19b6486d38 Correctly compute live variable information for physical registers
when an implicitely defined register is later used by an alias. For example:

         call foo
         %reg1024 = mov %AL

The call implicitely defines EAX but only AL is used. Before this fix
no information was available on AL. Now EAX and all its aliases except
AL get defined and die at the call instruction whereas AL lives to be
killed by the assignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10813 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 06:24:30 +00:00
Chris Lattner
504e8fb74e 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.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10812 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 05:51:55 +00:00
Chris Lattner
3a534f200a Implement new Instruction::isRelational method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10810 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 23:18:25 +00:00
Chris Lattner
eab20b58b1 Rearrange and comment code better. No functionality changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10808 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 22:07:24 +00:00
Chris Lattner
cbfd406541 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10807 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 21:13:12 +00:00
Chris Lattner
8b0f0cb908 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10806 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 21:02:29 +00:00
Chris Lattner
6b7b91ab03 Move ConstantHandling.h into lib/VMCore and out of include/llvm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10805 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 20:48:11 +00:00
Chris Lattner
731ba7f032 Eliminate a lot of out-of-date comments, and all of the wierd overloaded
operator constant folding stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10803 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 20:43:44 +00:00
Chris Lattner
4a0ecc8c0c Eliminate usage of the wierd overloaded operator constant folders
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10802 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 20:41:05 +00:00
Chris Lattner
d4403b4c3a Eliminate ConstantFoldShiftInstruction reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10801 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 20:40:42 +00:00
Chris Lattner
67bb7603ea Remove use of ConstantHandling itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10800 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 20:13:04 +00:00
Chris Lattner
7822c2ae07 Clean up #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10799 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:56:36 +00:00
Chris Lattner
76f7fe25d9 Fix bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10798 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:47:05 +00:00
Chris Lattner
7c4049c5a0 Eliminate use of ConstantHandling and ConstantExpr::getShift interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10796 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:35:11 +00:00
Chris Lattner
b6ac8bc586 Add header file I accidentally removed in teh shuffle
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10795 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:15:20 +00:00
Chris Lattner
69b9e892b6 Fix out of date comment, remove use of ConstantExpr::getShift
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10794 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:12:58 +00:00
Chris Lattner
5585b335e5 Remove use of the ConstantHandling interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10793 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:12:50 +00:00
Chris Lattner
c6646ebdb9 Remove use of ConstantExpr::getShift
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10792 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:10:58 +00:00
Chris Lattner
b16689b647 Don't use ConstantExpr::getShift anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10791 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:08:43 +00:00