Chris Lattner
5730220037
Remove obsolete comment. Unreachable blocks will automatically be left at the
...
end of the function.
llvm-svn: 11313
2004-02-11 05:20:50 +00:00
Chris Lattner
ca52c22356
Add an _embarassingly simple_ implementation of basic block layout. This is
...
more of a testcase for profiling information than anything that should reasonably
be used, but it's a starting point. When I have more time I will whip this into
better shape.
llvm-svn: 11311
2004-02-11 04:53:20 +00:00
Chris Lattner
4418633216
Implement SimplifyCFG/PhiEliminate.ll
...
Having a proper 'select' instruction would allow the elimination of a lot
of the special case cruft in this patch, but we don't have one yet.
llvm-svn: 11307
2004-02-11 03:36:04 +00:00
Chris Lattner
754914b142
The hasConstantReferences predicate always returns false.
...
llvm-svn: 11301
2004-02-11 01:17:07 +00:00
Chris Lattner
d2c679e5f6
initialization calls now return argc. If the program uses the argc value
...
passed into main, make sure they use the return value of the init call
instead of the one passed in.
llvm-svn: 11262
2004-02-10 17:41:01 +00:00
Chris Lattner
e961c1189f
Only add the global variable with the abort message if an unwind actually
...
occurs in the program.
llvm-svn: 11249
2004-02-09 22:48:47 +00:00
Chris Lattner
255269e677
Don't depend on auto data conversion
...
llvm-svn: 11229
2004-02-09 05:16:30 +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
6ef23e7e64
The ConstantExpr::getCast call can cause a CPR to be generated. If so,
...
strip it off.
llvm-svn: 11213
2004-02-09 00:20:55 +00:00
Misha Brukman
58ca173834
Fix grammar-o.
...
llvm-svn: 11210
2004-02-08 22:27:33 +00:00
Chris Lattner
a9887d33e8
Improve compatibility with programs that already have a prototype for 'write',
...
even if it is wierd in some way.
llvm-svn: 11207
2004-02-08 22:14:44 +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
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
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
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
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
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
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
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
d655075e9d
Remove unneeded code now that splitBasicBlock does the "right thing"
...
llvm-svn: 11111
2004-02-04 03:21:51 +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
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
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
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
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
3575c84933
Fix the count of the number of instructions removed
...
llvm-svn: 11049
2004-02-01 05:15:07 +00:00
Misha Brukman
6d62b1ee69
Hyphenate `target-dependent'
...
llvm-svn: 11003
2004-01-28 20:43:01 +00:00
Chris Lattner
f149ec635a
Fix InstCombine/2004-01-13-InstCombineInvokePHI.ll, which also fixes lots
...
of C++ programs in Shootout-C++, including lists1 and moments, etc
llvm-svn: 10845
2004-01-14 06:06:08 +00:00
Chris Lattner
7bfaf8bba8
Clean up #includes
...
llvm-svn: 10799
2004-01-12 19:56:36 +00:00
Chris Lattner
68c5d9e0d6
Fix bug in previous checkin
...
llvm-svn: 10798
2004-01-12 19:47:05 +00:00
Chris Lattner
7d2328f69c
Eliminate use of ConstantHandling and ConstantExpr::getShift interfaces
...
llvm-svn: 10796
2004-01-12 19:35:11 +00:00
Chris Lattner
f4c2dcbe21
Add header file I accidentally removed in teh shuffle
...
llvm-svn: 10795
2004-01-12 19:15:20 +00:00
Chris Lattner
de401bbd4b
Remove use of the ConstantHandling interfaces
...
llvm-svn: 10793
2004-01-12 19:12:50 +00:00
Chris Lattner
47e9056669
Remove use of ConstantExpr::getShift
...
llvm-svn: 10792
2004-01-12 19:10:58 +00:00
Chris Lattner
758109ce2e
Don't use ConstantExpr::getShift anymore
...
llvm-svn: 10791
2004-01-12 19:08:43 +00:00
Chris Lattner
23da5dbed6
Remove use of ConstantHandling
...
llvm-svn: 10789
2004-01-12 18:35:03 +00:00
Chris Lattner
4db788b6c5
Remove unneeded #include
...
llvm-svn: 10788
2004-01-12 18:33:54 +00:00
Chris Lattner
7242f6af5f
Move llvm::ConstantFoldInstruction from VMCore to here, next to ConstantFoldTerminator
...
llvm-svn: 10785
2004-01-12 18:25:22 +00:00
Chris Lattner
a5101c4743
Remove uses of ConstantHandling itf
...
llvm-svn: 10783
2004-01-12 18:12:44 +00:00
Chris Lattner
5a9246fb56
Use constantexprs for casts. Eliminate use of the ConstantHandling interfaces
...
llvm-svn: 10779
2004-01-12 17:43:40 +00:00