Chris Lattner
7e02b7e600
Optimizations got their own header files
...
Optimizations now live in the 'opt' namespace
include/llvm/Opt was renamed include/llvm/Optimizations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-30 04:36:40 +00:00
Chris Lattner
28bf86ac00
Implement reduceApply method
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-30 04:35:40 +00:00
Chris Lattner
a7e26118a2
Add a new pop_back() method
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-30 04:35:21 +00:00
Chris Lattner
b9b8959091
The ConstRules class got moved to the opt namespace
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-30 04:35:01 +00:00
Chris Lattner
d180e0fda7
Add a reduceApply method
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-30 04:34:42 +00:00
Chris Lattner
50d0b7ec3f
Split AllOpts.h into lots of little .h files.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-30 04:34:07 +00:00
Chris Lattner
2b05880476
Export ConstantFoldTerminator, allow it to fold conditional branches to
...
the same label.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-29 23:56:58 +00:00
Chris Lattner
cb056de508
Added documentation. Constant fold terminators.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-29 23:56:23 +00:00
Chris Lattner
4b52471bed
Added prototype for ConstantFoldTerminator
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-29 23:56:00 +00:00
Chris Lattner
7b8ec2d752
Add a check to avoid allowing V->replaceAllUsesWith(V)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-29 05:25:51 +00:00
Chris Lattner
b47af25099
Add implementation of BasicBlock::removePredecessor code that was factored
...
out of DCE.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-29 05:25:23 +00:00
Chris Lattner
25d17a5001
* Factored RemovePredecessorFromBlock into BasicBlock::removePredecessor
...
* Avoid messing around with this case:
br label %A
%A: br label %A
* Enable optimizations that are correct now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-29 05:24:28 +00:00
Chris Lattner
bca26a4c6b
We need to make sure to remove PHI nodes in the successor that cannot be
...
executed when removing branch dest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-29 05:23:10 +00:00
Chris Lattner
1be1d79a1d
Added a note about a new verification the verifier should do
...
Removed a redundant check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-29 05:22:12 +00:00
Chris Lattner
7b6f5a3ee9
Added new removePredecessor method prototype
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-29 05:21:42 +00:00
Chris Lattner
3f7fe711fb
Added note, moved note
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-29 05:21:05 +00:00
Chris Lattner
b19e59cb8d
Fixed the obnoxious problem that caused an entire directory to rebuild
...
even if you only change one .cpp file. Yaay
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-29 05:20:16 +00:00
Chris Lattner
7fc9fe3439
Miscellaneous cleanups:
...
* Convert post to pre-increment for for loops
* Use generic programming more
* Use new Value::cast* instructions
* Use new Module, Method, & BasicBlock forwarding methods
* Use new facilities in STLExtras.h
* Use new Instruction::isPHINode() method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:41:11 +00:00
Chris Lattner
138a124f09
Add a new Sparse Conditional Constant Propogation pass
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:38:11 +00:00
Chris Lattner
241b064267
Add command line arguments for Constant Pool Merging & Sparse Conditional Constant Prop
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:37:58 +00:00
Chris Lattner
b351ab8c1b
Put in test of SCCP. Watch out though, because we need to sort the
...
constant pool for the final check to work. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:37:22 +00:00
Chris Lattner
8a36b31e1a
Change to use the new GenericBinaryInst class. Support lots more operators.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:36:49 +00:00
Chris Lattner
3b34c59dcb
Misc cleanup
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:36:09 +00:00
Chris Lattner
531450d8a6
* Expose DoConstantPoolMerging
...
* Cleanups (post->pre increment, new cleaner API, etc)
* Moved stuff into ConstantHandling.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:35:26 +00:00
Chris Lattner
079df31921
Convert ugly postincrement to efficient preincrement
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:34:01 +00:00
Chris Lattner
42e018c805
* Move stuff around a bit.
...
* Add reduce_apply_bool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:32:12 +00:00
Chris Lattner
6bb09d96a0
Add instructions to fold unary and binary instructions.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:31:34 +00:00
Chris Lattner
3596366bed
* Use the new reduce_apply_bool template
...
* Expose Constant Pool Merging from ConstantProp.cpp
* Include definitions for SCCP pass
* InstListType is not neccesary anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:31:14 +00:00
Chris Lattner
776885f34d
getBasicBlocks() is not needed anymore for reading Method data
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:30:11 +00:00
Chris Lattner
a576e17ced
Added methods to make dealing with switches and branch instructions
...
more tolerable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:29:41 +00:00
Chris Lattner
eef4d787f0
Minor formating changes
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:29:21 +00:00
Chris Lattner
9af81a685e
Make a new GenericBinaryInst class, instead of providing lots of silly
...
little classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:28:50 +00:00
Chris Lattner
17262f7784
Convert postincrements to more efficient preincrements
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:28:02 +00:00
Chris Lattner
e02cb164b1
Add a new slew of functions to allow dynamic_cast<> like operation for
...
upcasting Value's to their subclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:27:42 +00:00
Chris Lattner
1020b3982c
Add extra forwarding accessor methods so that getMethodList(), getBasicBlocks()
...
and getInstList() are obsolete... except for when modifying those lists. This
makes code much more succinct and to the point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:26:41 +00:00
Chris Lattner
0305cfd3cc
Add more notes
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:24:50 +00:00
Chris Lattner
cfce6c0686
Filter out some more stuff
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:24:22 +00:00
Chris Lattner
20554f11d0
Moved UnaryOperator::create to InstrTypes.cpp until there is an iUnaryOps.cpp
...
Moved BinaryOperator::create to iBinaryOperators.cpp
Add getUniqueName to SymbolTable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-25 07:33:13 +00:00
Chris Lattner
d473a0acc4
Implement induction variable injection!
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-25 07:32:19 +00:00
Chris Lattner
bebd60dc9d
Renamed get.*Operator to create seeing that it would have to be qualified
...
with the classname anyways.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-25 07:31:31 +00:00
Chris Lattner
3bcd6394ec
* Rename get.*Operator to create seeing that it would have to be qualified
...
with the classname anyways.
* Add an isPHINode() method to Instruction
* Add getUniqueName() to SymbolTable class
* Add an insert method to ValueHolder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-25 07:31:05 +00:00
Chris Lattner
53b1c0161d
A silly stupid test of the loop depth calculator was added. REMOVE in the
...
future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-25 03:55:37 +00:00
Chris Lattner
23e36625a2
IntervalPartition: recode to use IntervalIterator to do all the work
...
LoopDepth.cpp: new file that calculates the depth of a loop, using
IntervalPartitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-25 03:55:04 +00:00
Chris Lattner
3704c8cfff
Add a helper function bind_obj
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-25 03:54:32 +00:00
Chris Lattner
4dd88f6fbf
Big changes. Interval*.h is now more or less finalized. IntervalPartition
...
is recoded to use IntervalIterators. IntervalIterators can now maintain
their own memory or let an external entity do it.
Loop depth is a new user of IntervalPartition for calculating the loop
nesting depth of a basic block
TODO: add IntervalPartition capability to split intervals between the looping
portion and the "tail" portion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-25 03:54:14 +00:00
Chris Lattner
d6a7b7552f
CFG.h: change the iterator tag
...
Method.h: Add an iterator type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-25 03:52:19 +00:00
Chris Lattner
5289d52a55
ValueHolder's aren't interseting to me anymore
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-25 03:51:53 +00:00
Chris Lattner
2d676c961e
New file due to the Intervals.h splitup
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-24 04:07:44 +00:00
Chris Lattner
a9a96efba4
New files due to the Intervals.h splitup
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-24 04:07:37 +00:00
Chris Lattner
4ea55136c1
Add a useless phi for testing with InductionVariables stuff
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-24 04:06:23 +00:00