Commit Graph

10305 Commits

Author SHA1 Message Date
Alkis Evlogimenos a97abeb342 Change live interval representation. Machine instructions now have two
slots each. As a concequence they get numbered as 0, 2, 4 and so
on. The first slot is used for operand uses and the second for
defs. Here's an example:

0: A = ...
2: B = ...
4: C = A + B ;; last use of A

The live intervals should look like:

A = [1, 5)
B = [3, x)
C = [5, y)

llvm-svn: 11141
2004-02-05 22:55:25 +00:00
Chris Lattner c0c953f0bc Fix bug updating dominators
llvm-svn: 11140
2004-02-05 22:33:26 +00:00
Chris Lattner f978c421e5 Add debug output
llvm-svn: 11139
2004-02-05 22:33:19 +00:00
Chris Lattner aaaaec43e7 Bug fixed
llvm-svn: 11138
2004-02-05 21:16:42 +00:00
Chris Lattner 14ab84a483 Fix PR223: Loopsimplify incorrectly updates dominator information
The problem is that the dominator update code didn't "realize" that it's
possible for the newly inserted basic block to dominate anything.  Because
it IS possible, stuff was getting updated wrong.

llvm-svn: 11137
2004-02-05 21:12:24 +00:00
Chris Lattner eba3c36f99 New testcase for PR223: Loopsimplify incorrectly updates dominator information
llvm-svn: 11136
2004-02-05 21:11:38 +00:00
Alkis Evlogimenos 1165c1081e We don't need to scan the blocks that we are live-in on every
access. Rather we only have to do it on the creation of the interval.

llvm-svn: 11135
2004-02-05 20:45:40 +00:00
Chris Lattner 66c16d144e s/gcse/scalarrepl
llvm-svn: 11133
2004-02-05 17:31:37 +00:00
Chris Lattner e3f247bcac In a "seeing the forest through the trees" kinda situation, I realized that a
complete rewrite of load-vn will make it a bit faster.  This changes speeds up
the gcse pass (which uses load-vn) from 25.45s to 0.42s on the testcase in
PR209.

I've also verified that this gives the exact same results as the old one.

llvm-svn: 11132
2004-02-05 17:20:00 +00:00
Chris Lattner d3e4d81ad7 This is a big diff with no functionality change. We just reorder some code,
which causes big reindentation.  While I'm at it, I fix the fixme by removing
some dead code.

llvm-svn: 11131
2004-02-05 05:56:23 +00:00
Chris Lattner 90b9043ea5 finegrainify namespacification
llvm-svn: 11130
2004-02-05 05:51:40 +00:00
Tanya Lattner dd0c255d14 Added missing include.
llvm-svn: 11129
2004-02-05 05:04:39 +00:00
Tanya Lattner cb435541c4 Fixed Chris' typo.
llvm-svn: 11128
2004-02-05 04:45:21 +00:00
Chris Lattner f127d9cf33 qoi bug fixed
llvm-svn: 11127
2004-02-05 00:48:41 +00:00
Chris Lattner 5bab6301ac Implement optimizations for handling large basic blocks.
llvm-svn: 11126
2004-02-05 00:36:43 +00:00
Alkis Evlogimenos 327426411e Modify the two address instruction pass to remove the duplicate
operand of the instruction and thus simplify the register allocation.

llvm-svn: 11124
2004-02-04 22:17:40 +00:00
Chris Lattner 39ad6f2772 Minor speedup, don't query ValueMap each time through the loop
llvm-svn: 11123
2004-02-04 21:44:26 +00:00
Brian Gaeke fe66239860 Always replace instead of appending when creating archive files. It may be
slightly slower, but I think we can handle it, especially if it means
BytecodeLibs are correctly regenerated.

llvm-svn: 11122
2004-02-04 21:41:23 +00:00
Brian Gaeke 9ce98a7e9f Include <iosfwd> and <string> instead of <iostream>.
Take away the default iostream argument of createMachineFunctionPrinterPass(),
at Chris's request.

llvm-svn: 11121
2004-02-04 21:41:10 +00:00
Brian Gaeke 94b5c3cb91 Take away the default iostream argument of createMachineFunctionPrinterPass(),
at Chris's request.

llvm-svn: 11120
2004-02-04 21:41:01 +00:00
Brian Gaeke 5e442bb3f1 Clean out DESTLIBBYTECODE when making clean in runtime.
llvm-svn: 11119
2004-02-04 21:40:49 +00:00
Chris Lattner 6f8865bf9f 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%)

llvm-svn: 11118
2004-02-04 21:33:42 +00:00
Alkis Evlogimenos dbf4b42fde IMULri* instructions do not require their first two registers operands
to be the same (IOW they are not two address instructions).

llvm-svn: 11117
2004-02-04 17:21:04 +00:00
Chris Lattner 0fa8c7c321 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.

llvm-svn: 11116
2004-02-04 04:17:06 +00:00
Chris Lattner 4babe055d3 Check in header file I forgot before.
llvm-svn: 11115
2004-02-04 03:59:08 +00:00
Chris Lattner 8d414ad035 Adjust to the new BasicBlock ctor, which requires a function parameter
llvm-svn: 11114
2004-02-04 03:58:28 +00:00
Chris Lattner bb5f0db8d6 Adjust to the new BB ctor
llvm-svn: 11113
2004-02-04 03:57:50 +00:00
Chris Lattner 040ad3afa8 Delete the BasicBlock ctor that only takes a BasicBlock to insert before. This
fails when the basic block points to the function->end.  Instead, require that
the client pass in the function AND the basicblock to insert into.

llvm-svn: 11112
2004-02-04 03:57:34 +00:00
Chris Lattner 0ff9da5fed Remove unneeded code now that splitBasicBlock does the "right thing"
llvm-svn: 11111
2004-02-04 03:21:51 +00:00
Chris Lattner 9cda4bf8e5 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 18ef3fda57 More refactoring. Move alloca instructions and handle invoke instructions
before we delete the original call site, allowing slight simplifications of
code, but nothing exciting.

llvm-svn: 11109
2004-02-04 02:51:48 +00:00
Chris Lattner 9fc977eac4 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.

llvm-svn: 11108
2004-02-04 01:41:09 +00:00
Chris Lattner a6578ef318 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.

llvm-svn: 11107
2004-02-04 01:19:43 +00:00
Chris Lattner d8a232b716 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 c4c7ea5288 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 135dcc024b Revised version of a patch for PR222 that works with my version of gmake.
llvm-svn: 11104
2004-02-03 23:05:24 +00:00
Chris Lattner 3d96eb6fa6 Bug fixed
llvm-svn: 11103
2004-02-03 22:59:56 +00:00
Chris Lattner 6bd75a6223 Apply Michael Kahl's patch to fix the 'make tools-only' target when OBJDIR != SRCDIR.
See PR222.

llvm-svn: 11102
2004-02-03 22:56:40 +00:00
Chris Lattner ae51cae111 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.

llvm-svn: 11100
2004-02-03 22:34:12 +00:00
Chris Lattner 3784188620 Handle extremely trivial cases extremely efficiently. This speeds up
SRoA/mem2reg from 41.2s to 27.5s on the testcase in PR209.

llvm-svn: 11099
2004-02-03 22:00:33 +00:00
Chris Lattner d1b1992495 Generate ftst instructions for comparison against zero
llvm-svn: 11098
2004-02-03 18:54:04 +00:00
Chris Lattner 8a63001939 bug fixed
llvm-svn: 11097
2004-02-03 08:03:41 +00:00
Chris Lattner 3c8c72c54f Add the ftst instruction
llvm-svn: 11095
2004-02-03 07:27:50 +00:00
Chris Lattner 8161306139 Add support for one argument OneArgFP instructions
llvm-svn: 11094
2004-02-03 07:27:34 +00:00
Alkis Evlogimenos 3d100ef0ca 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.

llvm-svn: 11093
2004-02-03 01:13:07 +00:00
Alkis Evlogimenos 74b26f77a3 Revert changes. Will implement this using a different set of primitives
llvm-svn: 11091
2004-02-02 23:08:58 +00:00
Alkis Evlogimenos 6e34205653 Fix debugging output.
llvm-svn: 11088
2004-02-02 22:00:32 +00:00
Alkis Evlogimenos 6471e66fbb Correctly update def/use information for modified machine operands.
llvm-svn: 11087
2004-02-02 21:56:40 +00:00
Alkis Evlogimenos 5f03f684ed Add MachineOperand::setDef() and MachineOperand::setUse() so that the
TwoAddressInstructionPass can correctly update use/def information.

llvm-svn: 11086
2004-02-02 21:55:18 +00:00
Alkis Evlogimenos 86ff30deab Should be more careful. The previously applied change made all counts
outside of loops = 0.

llvm-svn: 11085
2004-02-02 20:29:57 +00:00