Chris Lattner
f98fefc1ea
Fix a major source of "type unsafety", where a cast is neccesary, but can
...
be put either before or after a load. We chose to cast the value loaded
instead of the pointer to load from.
Fixes bug: test/Regression/Transforms/LevelRaise/2002-05-10-LoadPeephole.ll
llvm-svn: 2621
2002-05-14 05:23:45 +00:00
Chris Lattner
b7688286c1
Implement elimination of loads
...
llvm-svn: 2620
2002-05-14 05:02:40 +00:00
Chris Lattner
9d013ca535
Invoke inst has side effects!
...
llvm-svn: 2619
2002-05-14 04:20:25 +00:00
Chris Lattner
e14cba5c34
New file
...
llvm-svn: 2618
2002-05-13 22:19:50 +00:00
Chris Lattner
fc14cb90a2
Trivial cleanups
...
llvm-svn: 2617
2002-05-13 22:04:46 +00:00
Chris Lattner
2735171cf5
Add method to check to see if two _Instructions_ dominate each other
...
llvm-svn: 2616
2002-05-13 22:03:16 +00:00
Chris Lattner
1b769f2a94
Initial checkin of LICM pass
...
llvm-svn: 2615
2002-05-10 22:44:58 +00:00
Chris Lattner
b04d5ecc11
expose LICM pass
...
llvm-svn: 2614
2002-05-10 22:44:37 +00:00
Chris Lattner
97b501879c
Add LICM pass to compiler
...
llvm-svn: 2613
2002-05-10 22:44:31 +00:00
Chris Lattner
5a85ea20e5
Add prototype for LICM pass
...
llvm-svn: 2612
2002-05-10 22:44:16 +00:00
Chris Lattner
1e198023b9
Add testcase for when there is no loop header
...
llvm-svn: 2611
2002-05-10 22:43:26 +00:00
Chris Lattner
717e99c79a
A basic test that LICM is working
...
llvm-svn: 2610
2002-05-10 22:27:49 +00:00
Chris Lattner
c2766aada8
Run LICM tests
...
llvm-svn: 2609
2002-05-10 22:21:38 +00:00
Chris Lattner
1215378a67
run LICM tests
...
llvm-svn: 2608
2002-05-10 22:21:25 +00:00
Chris Lattner
708b869951
Make sure to call the derived visit versions from the ranged iterator.
...
llvm-svn: 2607
2002-05-10 22:21:05 +00:00
Chris Lattner
590bcc9629
We actually need this code for the release build to prevent link errors,
...
un#ifdef it.
llvm-svn: 2606
2002-05-10 18:54:35 +00:00
Chris Lattner
ff9f677248
Add explicit abort so optimized build knows that the function does not return
...
llvm-svn: 2605
2002-05-10 18:53:55 +00:00
Chris Lattner
625396c63a
Add an explicit abort so that the optimized build knows the function does
...
not return.
llvm-svn: 2604
2002-05-10 18:53:21 +00:00
Chris Lattner
b9e591a7b5
* Allow a profile'd code build to be done with a simple 'make ENABLE_PROFILING=1'
...
* Only build tags for include, lib, and tools, not tests
* Turn on verbose output from bison to get information about shift/reduce
conficts (why isn't this the default??)
llvm-svn: 2603
2002-05-10 18:51:54 +00:00
Chris Lattner
24656ee8e4
Expose the lowerallocs pass
...
llvm-svn: 2602
2002-05-10 15:43:07 +00:00
Chris Lattner
adba963886
Add support for printing out statistics information when -stats is added to
...
the command line
llvm-svn: 2601
2002-05-10 15:38:35 +00:00
Chris Lattner
1bf8912c74
Fix some bugs, straighten stuff out, more work needs to be done.
...
llvm-svn: 2600
2002-05-10 15:37:35 +00:00
Chris Lattner
a9e4b660ff
Initial checkin of Statistic class
...
llvm-svn: 2599
2002-05-10 15:36:56 +00:00
Chris Lattner
8c131ef721
Initial checkin of Statistic class.
...
llvm-svn: 2598
2002-05-10 15:36:46 +00:00
Chris Lattner
0671b3db5d
* Add support for the -stats command line option to report how much is changed
...
* Make cast-of-self-ty DCE the dead cast instruction immediately instead of
waiting for it to be DCE'd by another sweep over the function. This speeds
this up noticably.
llvm-svn: 2597
2002-05-10 15:29:25 +00:00
Chris Lattner
d9e5159118
New testcase
...
llvm-svn: 2596
2002-05-10 15:14:54 +00:00
Chris Lattner
ca6c5955f4
remove deprecated getInstType() method
...
llvm-svn: 2595
2002-05-10 13:28:47 +00:00
Chris Lattner
25ae3ddf64
Expose the pi node insertion pass.
...
llvm-svn: 2594
2002-05-10 05:41:49 +00:00
Chris Lattner
2d91be1ab7
Initial checkin of the PiNodeInsertion pass
...
llvm-svn: 2593
2002-05-10 05:41:34 +00:00
Chris Lattner
93ba8ba0a9
Add prototype for the PiNodeInserter pass
...
llvm-svn: 2592
2002-05-10 05:40:37 +00:00
Chris Lattner
5295e03aa9
Test the Pi node inserter
...
llvm-svn: 2591
2002-05-10 05:38:39 +00:00
Chris Lattner
bfc208b405
Initial checkin of testcases for Pi node inserter
...
llvm-svn: 2590
2002-05-10 05:38:18 +00:00
Chris Lattner
a98304f4fa
Last minor cleanups, this code still does not work for all cases, but it
...
works much better than it used to.
llvm-svn: 2588
2002-05-09 21:31:18 +00:00
Chris Lattner
4ece8deba5
Two Cleanups to generated C code:
...
1. Avoid printing *(&globalvariable), instead print globalvariable alone
as a special case.
2. Inline subexpressions into expressions as much as legal that preserves
execution characteristics of expressions. Now we get nice (but
over-parenthesized, oh well) things like:
ltmp_428_7 = spec__putc(((unsigned char )((bsBuff) >> 24)), (bsStream));
instead of five seperate instructions (bsBuff & bsStream are globals).
llvm-svn: 2587
2002-05-09 21:18:38 +00:00
Chris Lattner
9a9b801669
* Remove CInstPrintVisitor class, incorporating it into the CWriter class
...
* Reorder code in the file to make it more logically laid out.
llvm-svn: 2586
2002-05-09 20:53:56 +00:00
Chris Lattner
3fd3c03371
Remove CLocalVars data structure entirely, instead of building stuff and
...
then printing it out, just print as we go.
llvm-svn: 2585
2002-05-09 20:39:03 +00:00
Chris Lattner
5ed180c1bd
Simplify code by removing InstLocalVarsVisitor, replacing it with a simple
...
inst_iterator.
llvm-svn: 2584
2002-05-09 20:33:35 +00:00
Chris Lattner
aa1d35be51
* Clean up how PHI nodes are handled
...
* Correct global variable references
* Fix loads & stores with zero indices
* Do not emit an else part of a branch if there is no code (no phi node
and a fallthrough branch), makes code more readable to get:
if (l2_cond240) {
goto l13_bb10;
}
with no else{} branch
llvm-svn: 2583
2002-05-09 20:14:10 +00:00
Chris Lattner
cd326f096f
Handle setcc <global*>, 0 instructions, Global pointers are never null!
...
llvm-svn: 2582
2002-05-09 20:11:54 +00:00
Chris Lattner
9de1aeb91c
Give the longer name to the instruction that will probably be eliminated later
...
llvm-svn: 2581
2002-05-09 20:11:23 +00:00
Chris Lattner
160b51de7d
New testcase for wierd combine opportunity found in bzip2 benchmark
...
llvm-svn: 2580
2002-05-09 19:52:36 +00:00
Chris Lattner
94e4578db4
Emit:
...
l3_reg109 = l81_this->field0;
Instead of:
l3_reg109 = l81_this[0u].field0;
where possible
llvm-svn: 2579
2002-05-09 15:59:50 +00:00
Chris Lattner
97ae8c039e
* Print structures types correctly
...
* Clean up generated code to not emit basic block labels and goto
instructions if they are unneccesary (for example, fall throughs)
llvm-svn: 2578
2002-05-09 15:49:41 +00:00
Chris Lattner
93fb65370c
* Continue cleanup of type printing code
...
* Print a newline after a malloc instruction
* Convert unprintable characters to x_ instead of _x so that we don't
generate identifiers that start with underscores
llvm-svn: 2577
2002-05-09 15:18:52 +00:00
Chris Lattner
b3acea93cf
Gut the type printing code so there is only one copy of it instead of 3
...
llvm-svn: 2576
2002-05-09 14:40:11 +00:00
Chris Lattner
619c55baec
* Remove dead "constant printing" code
...
* Mangle names with only a prefix so that they are easier on the eyes.
* Put spaces around binary operators with low precedence to make them easier to read
* Don't prefix function names with &, although it's correct, it's unnecesary and
easier to read without it.
llvm-svn: 2575
2002-05-09 05:16:40 +00:00
Chris Lattner
cde698978f
Remove gross "Operand" instance variable
...
Remove lots of unneccesary arguments to methods
llvm-svn: 2574
2002-05-09 04:39:00 +00:00
Chris Lattner
e8573f21c7
Simplify and clean up function calls.
...
Now indirect function calls work, except that function pointer types are not correct.
llvm-svn: 2573
2002-05-09 04:21:21 +00:00
Chris Lattner
72286b8a3b
* Remove dead function
...
* Print C strings correctly
* Expand C escape sequences nicely (ie \n \t, etc get generated instead of hex escapes)
llvm-svn: 2572
2002-05-09 03:56:52 +00:00
Chris Lattner
c7b3367aad
Make Getelementptr, load & store all work the right way.
...
Handle global variables correctly.
llvm-svn: 2571
2002-05-09 03:50:42 +00:00