Chris Lattner
148a0bfcea
Checkin headers for Utils library
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2528 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:52:48 +00:00
Chris Lattner
96bcfc30dc
Cleanup implementation a bit + comments
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2527 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:51:44 +00:00
Chris Lattner
b444a1fff4
Cleanup implementation a bit
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2526 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:51:25 +00:00
Chris Lattner
fbfa18ce6c
Change script to not even look in test/ directory, significantly speeding it up
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2525 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:42:09 +00:00
Chris Lattner
2b5235d650
Oops, somehow lost a slash. Fixed
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2524 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:39:52 +00:00
Chris Lattner
c8cc4cb03b
Updates to move some header files out of include/llvm/Transforms into
...
the Scalar and Utils subdirectories
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2523 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:36:35 +00:00
Chris Lattner
efbe5d682b
Update header after moving file
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2522 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:34:57 +00:00
Chris Lattner
2d95aa29f8
Remove long dead file
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2521 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:20:10 +00:00
Chris Lattner
2154d13354
Straighten out makefiles after moving code to new Transform Utils library
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2520 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:18:26 +00:00
Chris Lattner
88d15ab0d6
Factor code out to the Transform Utils library
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2519 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:18:00 +00:00
Chris Lattner
497c60c0ed
Reduce dependance on TransformInternals.h, instead using the TransformUtils library
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2518 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:12:18 +00:00
Chris Lattner
6d7491c3cc
Add #include no longer included by llvm/Transforms/Scalar/ConstantProp.h
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2517 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:11:30 +00:00
Chris Lattner
2ed01d8f0b
Factor code out to the TransformUtils library
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2516 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:10:55 +00:00
Chris Lattner
5a4337a8fc
Factor code out of TransformInternals into the Transform Utils library
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2515 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:09:15 +00:00
Chris Lattner
0ed2e4b554
Build Transforms Utils library
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2514 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:08:50 +00:00
Chris Lattner
4d1e46e7b0
Add code pulled out of TransformInternals.cpp, ConstProp.cpp, and DCE.cpp
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2513 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:07:59 +00:00
Chris Lattner
071d0ad2f1
* Convert InstWorkList to vector instead of set, because on big programs it
...
is empirically faster by a noticable margin, even though duplicates can
happen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2511 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 04:29:32 +00:00
Chris Lattner
92deeaf7a3
* Remove all cfg simplification stuff for a new cfg simplify pass (todo)
...
* Convert to worklist instead of iterative algorithm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2510 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 04:24:11 +00:00
Chris Lattner
6536cfec4a
Finish up the updates to the language reference
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2509 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 22:08:29 +00:00
Chris Lattner
07a228d1f7
Mark analyses that only depend on the CFG of a function
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2507 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 19:32:07 +00:00
Chris Lattner
27ad137d5e
Make functions that preserve the CFG not invalidate analyses that only depend
...
on the CFG of a function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2506 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 19:31:52 +00:00
Chris Lattner
4445519fab
Add support for passes to announce that they only depend on the CFG of a
...
function. This is crude but effective
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2505 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 19:31:16 +00:00
Chris Lattner
d661937352
Only do masking for unsigned values!
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2504 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 18:54:59 +00:00
Chris Lattner
5f06e10a84
GCSE is faster than SCCP, and it makes SCCP's job easier, so run it first.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2503 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 18:54:12 +00:00
Chris Lattner
89df1b58a9
* Eliminate dead code that should have been removed in last revision
...
* Convert main constant propogation pass to be worklist driven instead of
iterative.
* -constprop pass no longer "constant propogates" terminator instructions
- CFG is now preserved!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2502 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 18:21:31 +00:00
Chris Lattner
473945d1dc
Handle X = phi Y --> X = Y
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2501 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 18:06:38 +00:00
Chris Lattner
fee97e83ce
Make the testcase more interesting so that DCE does not eliminate it.
...
Use DIE instead of DCE anyway
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2500 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:59:23 +00:00
Chris Lattner
a803899af5
Move a bunch of code to a .cpp file, don't #include Instruction.h
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2499 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:54:50 +00:00
Chris Lattner
178414c3cf
Move code out of header file
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2498 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:54:27 +00:00
Chris Lattner
f51825e3fb
* Use simplified interface to constant propogation stuff.
...
* Remove dead PHI case (which could not work due to getNumOperands rather than
getNumIncomingValues. This really belongs in InstCombine, anyway so we'll
move it there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2497 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:54:10 +00:00
Chris Lattner
db93124d41
Add #include removed from ConstantHandling.h
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2496 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:53:10 +00:00
Chris Lattner
32e1740c7c
New testcase for PHI folding
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2495 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:43:38 +00:00
Chris Lattner
dfe81ab87a
Clean up ADCE by removing extraneous wrapper class
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2494 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:27:57 +00:00
Chris Lattner
ed3a55005d
Combine not (not X) -> X
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2493 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:03:21 +00:00
Chris Lattner
9bfed886a8
New testcase to make sure not instructions get combined
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2492 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:00:47 +00:00
Chris Lattner
eadd32cda2
Instruction Combination can create a ton of trivially dead instructions. Remove
...
them with an DIE pass before more expensive optimizations are run.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2491 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:52:15 +00:00
Chris Lattner
b35dde1df4
Support more cases...
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2490 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:49:18 +00:00
Chris Lattner
fa78358a05
More tests
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2489 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:44:53 +00:00
Chris Lattner
c1bfd13c0a
Add testcase for -(-A)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2488 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:19:16 +00:00
Chris Lattner
45d8b917be
Change usage of isPointerType to use isa
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2487 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:15:49 +00:00
Chris Lattner
9b625030c8
Replace all usages of Type::isPointerType with isa<PointerType>
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2486 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:15:30 +00:00
Chris Lattner
d44023ecb7
Implement getPrimitiveSize()
...
don't use isPointerType()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2485 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:14:39 +00:00
Chris Lattner
3f5b877dd4
Add many more instruction combination simplifications
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2484 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:14:14 +00:00
Chris Lattner
4dedcb2670
* Add getPrimitiveSize method
...
* Remove isPointerType, isMethodType, etc... methods. Use isa<> instead
* Added specialization of isa for pointer types so that DerivedTypes.h doesn't
have to be #included to use isa<PointerType>(..)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2483 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:12:53 +00:00
Chris Lattner
79a31b1782
Fix testcase, the 'shift out all bits' doesn't apply to signed types.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2482 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:11:31 +00:00
Chris Lattner
11fe8dfff7
Void and Label values cannot be acted on directly so they have zero size
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2481 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 15:10:15 +00:00
Chris Lattner
829b79dd8c
More testcases I don't want to forget about
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2480 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 05:51:26 +00:00
Chris Lattner
33a90b18e0
New testcases so I don't forget about these algebraic simplifications
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2479 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 05:43:36 +00:00
Chris Lattner
97555b59b3
New testcase so I don't forget about this.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2478 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 05:35:20 +00:00
Chris Lattner
c3a53f9aa8
Testcase for missed merge opportunity
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2477 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 03:11:32 +00:00