1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
Commit Graph

5305 Commits

Author SHA1 Message Date
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
70d893a160 Fix PR225: [pruneeh] -pruneeh pass removes invoke instructions it shouldn't
llvm-svn: 11200
2004-02-08 21:15:59 +00:00
Chris Lattner
46c84561b2 splitBasicBlock "does the right thing" now, no reason to reposition it.
llvm-svn: 11199
2004-02-08 20:49:07 +00:00
Chris Lattner
1c646349df Implement proper invoke/unwind lowering.
This fixed PR16 "[lowerinvoke] The -lowerinvoke pass does not insert calls to setjmp/longjmp"

llvm-svn: 11195
2004-02-08 19:53:56 +00:00
Chris Lattner
ecaa4c58e2 Print out all globals as they are emitted, not just those emitted from
emitGlobals

llvm-svn: 11191
2004-02-08 19:33:23 +00:00
Chris Lattner
ffd16b0190 There is no reason to #define fd
llvm-svn: 11190
2004-02-08 19:33:07 +00:00
Chris Lattner
f549f9473e Add a call to 'write' right before the call to abort() in the unwind path.
This causes the JIT, or LLC'd program to print out a nice message, explaining
WHY the program aborted.

llvm-svn: 11184
2004-02-08 07:30:29 +00:00
Chris Lattner
838c2dd5af Add one that I missed
llvm-svn: 11179
2004-02-08 01:53:10 +00:00
Chris Lattner
cc1376078c Instead of callign removeTriviallyDeadNodes on the global graph every time
removeDeadNodes is called, only call it at the end of the pass being run.
This saves 1.3 seconds running DSA on 177.mesa (5.3->4.0s), which is
pretty big.  This is only possible because of the automatic garbage
collection done on forwarding nodes.

llvm-svn: 11178
2004-02-08 01:51:48 +00:00
Chris Lattner
e2ee216e1f Remove another unneeded call.
llvm-svn: 11177
2004-02-08 01:40:40 +00:00
Chris Lattner
85ba7bbf78 This call is no longer needed now that merging does not produce garbage
llvm-svn: 11176
2004-02-08 01:38:34 +00:00
Chris Lattner
32a3eb0b88 Substantially improve the DSA code by removing 'forwarding' nodes from
DSGraphs while they are forwarding.  When the last reference to the forwarding
node is dropped, the forwarding node is autodeleted.  This should simplify
removeTriviallyDead nodes, and is only (efficiently) possible because we are
using an ilist of dsnodes now.

llvm-svn: 11175
2004-02-08 01:27:18 +00:00
Chris Lattner
84ff796305 Bugfix for ilist conversion. The ilist wants to make an 'end' node which has
G == 0

llvm-svn: 11174
2004-02-08 01:05:37 +00:00
Chris Lattner
29067016a4 Switch the Nodes list from being an std::vector<DSNode*> to an ilist<DSNode>
llvm-svn: 11173
2004-02-08 00:53:26 +00:00
Chris Lattner
2c836fc933 Change to use node_iterators instead of direct access to Nodes
llvm-svn: 11171
2004-02-08 00:23:16 +00:00
Chris Lattner
6af67c7eb4 getNodes() is gone, use node_begin/end instead
Rename stats from dsnode -> dsa
Add a new stat

llvm-svn: 11167
2004-02-07 23:58:05 +00:00
Chris Lattner
ed36ca5f13 getNodes() is gone
llvm-svn: 11166
2004-02-07 23:57:26 +00:00
Chris Lattner
ce838bfae6 There is no need to clone over nodes that are going to be dead anyway
llvm-svn: 11157
2004-02-07 22:00:03 +00:00
Alkis Evlogimenos
59bb9d69c7 Increase code clarity.
llvm-svn: 11151
2004-02-06 18:08:18 +00:00
Alkis Evlogimenos
2aa7703205 Eliminate uneeded lookups by passing a Virt2PhysMap::iterator instead
of the virtual register to certain functions.

llvm-svn: 11143
2004-02-06 03:15:40 +00:00
Chris Lattner
3f57a7faab Fix another dominator update bug. These bugs keep getting exposed because GCSE
keeps finding more code motion opportunities now that the dominators are correct!

llvm-svn: 11142
2004-02-05 23:20:59 +00:00
Alkis Evlogimenos
f01a26ceaa 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
f2a8b9e75b Fix bug updating dominators
llvm-svn: 11140
2004-02-05 22:33:26 +00:00
Chris Lattner
3846a304eb Add debug output
llvm-svn: 11139
2004-02-05 22:33:19 +00:00
Chris Lattner
6875c14234 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
Alkis Evlogimenos
3dd0f57349 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
ffc5eee17a 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
1a04f2a635 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
7d5e3febb7 finegrainify namespacification
llvm-svn: 11130
2004-02-05 05:51:40 +00:00
Tanya Lattner
0221566368 Added missing include.
llvm-svn: 11129
2004-02-05 05:04:39 +00:00
Tanya Lattner
d7b137d9fb Fixed Chris' typo.
llvm-svn: 11128
2004-02-05 04:45:21 +00:00
Chris Lattner
b721589bc0 Implement optimizations for handling large basic blocks.
llvm-svn: 11126
2004-02-05 00:36:43 +00:00
Alkis Evlogimenos
676e5b8997 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
342b7276d6 Minor speedup, don't query ValueMap each time through the loop
llvm-svn: 11123
2004-02-04 21:44:26 +00:00
Brian Gaeke
dcab84ecf1 Take away the default iostream argument of createMachineFunctionPrinterPass(),
at Chris's request.

llvm-svn: 11120
2004-02-04 21:41:01 +00:00
Chris Lattner
cbe1dd55f4 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
a5458ae146 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
790d7321b4 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
68aef33986 Adjust to the new BasicBlock ctor, which requires a function parameter
llvm-svn: 11114
2004-02-04 03:58:28 +00:00
Chris Lattner
223ffefd1f Adjust to the new BB ctor
llvm-svn: 11113
2004-02-04 03:57:50 +00:00
Chris Lattner
d655075e9d Remove unneeded code now that splitBasicBlock does the "right thing"
llvm-svn: 11111
2004-02-04 03:21:51 +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
8f0a362cd4 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
ab01a0e982 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
aa44b4de3e 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
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
2998d508b0 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
eee884cc98 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
92211eb77d Generate ftst instructions for comparison against zero
llvm-svn: 11098
2004-02-03 18:54:04 +00:00
Chris Lattner
7b6e8f1f70 Add the ftst instruction
llvm-svn: 11095
2004-02-03 07:27:50 +00:00
Chris Lattner
8b623358ff Add support for one argument OneArgFP instructions
llvm-svn: 11094
2004-02-03 07:27:34 +00:00
Alkis Evlogimenos
5e78d4bd75 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
e128cb3295 Revert changes. Will implement this using a different set of primitives
llvm-svn: 11091
2004-02-02 23:08:58 +00:00
Alkis Evlogimenos
a4fab12df8 Fix debugging output.
llvm-svn: 11088
2004-02-02 22:00:32 +00:00
Alkis Evlogimenos
3f268a9996 Correctly update def/use information for modified machine operands.
llvm-svn: 11087
2004-02-02 21:56:40 +00:00
Alkis Evlogimenos
dfef24298e 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
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
f2a481f7f8 Disable (x - (y - z)) => (x + (z - y)) optimization for floating point.
llvm-svn: 11083
2004-02-02 20:09:56 +00:00
Chris Lattner
343ab20a2d Update comment
llvm-svn: 11082
2004-02-02 20:09:22 +00:00
Chris Lattner
06f08a26ac No need to declare implicit uses/defs of ST0
llvm-svn: 11081
2004-02-02 19:57:45 +00:00
Brian Gaeke
1aa59f5107 Make deadarghaX0r warning louder.
(I just love typing haX0r.   haX0r haX0r haX0r.)

llvm-svn: 11079
2004-02-02 19:32:27 +00:00
Chris Lattner
71c12c8e0d Generate the fchs instruction to negate a floating point number
llvm-svn: 11078
2004-02-02 19:31:38 +00:00
Chris Lattner
36367e8c90 Add support for OneArgFPRW instructions, fix a couple of typeos
llvm-svn: 11077
2004-02-02 19:23:15 +00:00
Brian Gaeke
355bc299b7 Include PowerPC.h. Flesh out the stub versions of addPassesToEmitAssembly()
and addPassesToJITCompile() slightly.

llvm-svn: 11076
2004-02-02 19:06:36 +00:00
Brian Gaeke
24f70fa16d Add comments describing how you would add prototypes for factory methods for
PowerPC-specific passes here.

llvm-svn: 11073
2004-02-02 19:05:28 +00:00
Chris Lattner
963082346c Codegen -0.0 correctly. Do not use fldz! This is another -0.0 == +0.0 problem, arg.
llvm-svn: 11070
2004-02-02 18:56:30 +00:00
Alkis Evlogimenos
1825f30a3a Create an object for tracking physical register usage. This will look
much better when I get rid of the reserved registers.

llvm-svn: 11066
2004-02-02 07:30:36 +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
Alkis Evlogimenos
586dc51262 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.

llvm-svn: 11061
2004-02-01 20:13:26 +00:00
Alkis Evlogimenos
b2ea4389ca Use std::map::count() instead of std::map::find() != std::map::end()
where appropriate.

llvm-svn: 11060
2004-02-01 18:39:53 +00:00
Alkis Evlogimenos
eabb1b1bfa Change string for joined intervals.
llvm-svn: 11057
2004-02-01 16:13:05 +00:00
Alkis Evlogimenos
3c94357980 FpMOV is also a move instruction.
llvm-svn: 11055
2004-02-01 08:22:16 +00:00
Alkis Evlogimenos
e9d1aa31fc Change xor to ^.
llvm-svn: 11054
2004-02-01 08:19:25 +00:00
Chris Lattner
824015593c Disable tail duplication in any "hard" cases, where it might break SSA form.
llvm-svn: 11052
2004-02-01 06:32:28 +00:00
Chris Lattner
2e497b5e42 Fix a bug in a recent checkin
llvm-svn: 11050
2004-02-01 05:25:07 +00:00
Chris Lattner
3575c84933 Fix the count of the number of instructions removed
llvm-svn: 11049
2004-02-01 05:15:07 +00:00
Alkis Evlogimenos
107cf3892c Missed one silly assert :-)
llvm-svn: 11048
2004-02-01 02:21:31 +00:00
Alkis Evlogimenos
a7459c76aa Simplify joinIntervals() code.
llvm-svn: 11047
2004-02-01 02:18:31 +00:00
Chris Lattner
3818f475de Remove all of the annoying statistics now that I'm finished (for the near
term) working on bytecode size stuff.

llvm-svn: 11046
2004-02-01 01:50:31 +00:00
Alkis Evlogimenos
612a35f2a4 Use MRegisterInfo::isPhysicalRegister and
MRegisterInfo::isVirtualRegister.

llvm-svn: 11045
2004-02-01 01:27:01 +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
becd58c6cb Print an error message if we can't materialize the bytecode file
llvm-svn: 11043
2004-02-01 01:07:25 +00:00
Chris Lattner
c76f82c957 Print an error message if there is an error materialize the bc file.
llvm-svn: 11041
2004-02-01 00:32:35 +00:00
Alkis Evlogimenos
9559cebebf Apply final part of Chris' patch.
llvm-svn: 11040
2004-01-31 23:48:47 +00:00
Alkis Evlogimenos
656870703f Be a little smarter on the way we handle physical register defs.
llvm-svn: 11038
2004-01-31 23:13:30 +00:00
Chris Lattner
0ea56952d4 Finegrainify namespacification, use new MRegisterInfo::isVirtualRegister
method

llvm-svn: 11037
2004-01-31 21:27:19 +00:00
Chris Lattner
bff56dc518 Fix, correctly this time, the computation of the return value
Fix a spello
Tighten up the assertion checking

No functionality changes.

llvm-svn: 11036
2004-01-31 21:21:43 +00:00
Chris Lattner
05b7fef02f * Fix incorrect computation of the runOnMachineFunction return value
* Turn a bunch of instance variables into automatic variables

llvm-svn: 11035
2004-01-31 21:14:04 +00:00
Chris Lattner
b0addcc1b0 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

llvm-svn: 11034
2004-01-31 21:07:15 +00:00
Chris Lattner
89f03df701 Avoid referencing deleted DSgraphs when merging an SCC into a larger SCC. This
fixes the crash in 176.gcc.

llvm-svn: 11033
2004-01-31 21:02:18 +00:00
Alkis Evlogimenos
d1ec5f36ee Merge safe parts from last night's buggy commit. These do not break
any test cases :-)

llvm-svn: 11032
2004-01-31 19:59:32 +00:00
Alkis Evlogimenos
ef63827238 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.

llvm-svn: 11030
2004-01-31 16:54:54 +00:00
Alkis Evlogimenos
b9df133d67 Revert last night's changes as they broke some tests. Will remerge parts of the patch.
llvm-svn: 11029
2004-01-31 14:37:41 +00:00
Alkis Evlogimenos
c0db519832 Several performance enhancements and cleanups from Chris.
Simplification of LiveIntervals::Interval::overlaps() and addition of
examples to overlaps() and liveAt() to make them clearer.

llvm-svn: 11028
2004-01-31 04:56:07 +00:00
Chris Lattner
a497e3d6e1 Fix thinko
llvm-svn: 11027
2004-01-30 22:48:02 +00:00
Chris Lattner
f5b5d1f2f8 Add some comments sketching out how this is to work eventually.
llvm-svn: 11026
2004-01-30 22:25:18 +00:00
Chris Lattner
543fbaa973 Add a new flag, which is only used for symmetry.
llvm-svn: 11025
2004-01-30 22:24:18 +00:00
Chris Lattner
0127841d4e Forward method request to chained aa implementation
llvm-svn: 11024
2004-01-30 22:20:55 +00:00
Chris Lattner
8bcdaf9b5d Implement the pointsToConstantMemory() method.
llvm-svn: 11022
2004-01-30 22:17:24 +00:00