Chris Lattner
ee2e78b86c
Be careful not to make "external" function internal
...
llvm-svn: 2363
2002-04-28 05:48:34 +00:00
Chris Lattner
1b94c007dc
Initial checkin of new "Internalize" pass for GCCLD
...
llvm-svn: 2362
2002-04-28 05:43:27 +00:00
Chris Lattner
1467f64f01
Initial checkin of simple&fast SSA based GCSE algorithm
...
llvm-svn: 2338
2002-04-28 00:47:11 +00:00
Chris Lattner
99b6f5cac4
Change the Dominator info and LoopInfo classes to keep track of BasicBlock's, not
...
const BasicBlocks
llvm-svn: 2337
2002-04-28 00:15:57 +00:00
Chris Lattner
f998685cd9
s/Method/Function
...
llvm-svn: 2336
2002-04-27 07:27:19 +00:00
Chris Lattner
c8e665431b
* Rename MethodPass class to FunctionPass
...
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
- Method is now const
- It now takes one AnalysisUsage object to fill in instead of 3 vectors
to fill in
- Pass's now specify which other passes they _preserve_ not which ones
they modify (be conservative!)
- A pass can specify that it preserves all analyses (because it never
modifies the underlying program)
* s/Method/Function/g in other random places as well
llvm-svn: 2333
2002-04-27 06:56:12 +00:00
Chris Lattner
66cfaf1da2
Changes because the Terminator::getSuccessor function now FAILS if successor
...
IDX is out of range instead of returning null.
llvm-svn: 2332
2002-04-27 03:15:45 +00:00
Chris Lattner
0e0c15b17a
* Change Constant::getNullConstant to Constant::getNullValue
...
* Add support for pool allocating array allocations of varying size
llvm-svn: 2329
2002-04-27 02:29:32 +00:00
Chris Lattner
2716b5e524
Change Constant::getNullConstant to Constant::getNullValue
...
llvm-svn: 2323
2002-04-27 02:25:14 +00:00
Chris Lattner
271255b087
Programs that actually free memory were broken
...
llvm-svn: 2307
2002-04-18 22:11:30 +00:00
Chris Lattner
1c8d3f8996
Add a fixme so that we don't forget this is broken.
...
llvm-svn: 2298
2002-04-18 18:52:03 +00:00
Chris Lattner
260ab20422
Significantly rework InstructionCombining to work better and to be cleaner.
...
We now use an InstVisitor to delegate to different cases that we are
interested in handling. We also fix the FIXME's by adding users to the
worklist when appropriate.
llvm-svn: 2292
2002-04-18 17:39:14 +00:00
Chris Lattner
6e56079654
Convert SCCP over to use InstVisitor instead of hand crafted switch
...
llvm-svn: 2286
2002-04-18 15:13:15 +00:00
Chris Lattner
5873900709
GEP instructions can never be constant propogated.
...
llvm-svn: 2284
2002-04-18 14:44:13 +00:00
Chris Lattner
f40379e403
Store instructions always return void, so they never get a name
...
llvm-svn: 2283
2002-04-18 14:43:54 +00:00
Chris Lattner
3e78deaafd
Correctly transform dependant arguments, allowing the perimeter bm to work.
...
llvm-svn: 2282
2002-04-18 14:43:30 +00:00
Chris Lattner
cf73caa5e8
Add casts for documentation
...
llvm-svn: 2272
2002-04-16 22:10:52 +00:00
Chris Lattner
28a01b2069
* Clean up the code a bit
...
* Allow structs with negative offsets. This enables the em3d benchmark to
be made typesafe. In this case, the struct had an array as the first
element, so a negative index was ok (the expr was -8 + 8x)
llvm-svn: 2271
2002-04-16 22:10:36 +00:00
Chris Lattner
457e1accb2
run an extra pass after a function has been transformed to eliminate
...
obviously duplicate loads of the pool base.
llvm-svn: 2255
2002-04-15 22:42:23 +00:00
Chris Lattner
3a60d04722
Eliminate cast of same type instructions.
...
llvm-svn: 2251
2002-04-15 19:45:29 +00:00
Chris Lattner
7e35890072
* s/Method/Function
...
* Fix bug where the character after a % was being discarded
llvm-svn: 2248
2002-04-14 06:15:24 +00:00
Chris Lattner
acf1902ea9
Turn off debug output
...
llvm-svn: 2247
2002-04-14 06:14:41 +00:00
Chris Lattner
50e3d32d7b
* Allow datasize to be specified on the commandline
...
* Build new datatypes correctly
* Transform instructions that return null pointers from functions to return
a null index.
llvm-svn: 2244
2002-04-13 23:13:18 +00:00
Chris Lattner
5da145b962
* Give alloca's for pool descriptors better names than "pool<n>".
...
* Fill in the pool descriptor links in the pool descriptors.
llvm-svn: 2239
2002-04-13 19:52:54 +00:00
Chris Lattner
8f796d6310
* Add names to the symbol table for pool types and modified types
...
* Handle more complex structure so that power works almost
* Fix bug with pooldestroy call where we passed in the size of the object
instead of the pool to destroy. bisort is now pool allocated successfully!
llvm-svn: 2238
2002-04-13 19:25:57 +00:00
Chris Lattner
441e16f735
Implement function rewriting to use offsets instead of pointers in programs.
...
This now works with treeadd at least, and perhaps other programs as well.
llvm-svn: 2233
2002-04-12 20:23:15 +00:00
Chris Lattner
011ab80ed6
* Add documentation
...
* Split the CleanGCC pass into two passes, a global pass and an IP pass.
Before it was just a global pass, but it did illegal things to the
module, which broke other passes that were being scheduled with it by
gccld.
llvm-svn: 2224
2002-04-10 20:33:11 +00:00
Chris Lattner
fc6737835b
Implement TODO, fixing bug:
...
test/Regression/Transforms/LevelRaise/2002-04-09-MissedRaise.ll
llvm-svn: 2219
2002-04-09 20:53:36 +00:00
Chris Lattner
2e9fa6d101
Move FunctionArgument out of iOther.h into Argument.h and rename class to
...
be 'Argument' instead of FunctionArgument.
llvm-svn: 2216
2002-04-09 19:48:49 +00:00
Chris Lattner
06be180225
Add explicit #includes of Function.h to make up for the removed #include
...
in iOther.h
llvm-svn: 2209
2002-04-09 19:08:28 +00:00
Chris Lattner
d92b01c385
Add #includes to make up for #includes pruned out of header files.
...
llvm-svn: 2207
2002-04-09 18:37:46 +00:00
Chris Lattner
f8e4dc33ab
s/Method/Function
...
Remove extraneous #includes of llvm/Assembly/Writer
llvm-svn: 2178
2002-04-08 22:03:00 +00:00
Chris Lattner
65b529fe6d
ConstantHandling moved into VMCore library
...
llvm-svn: 2165
2002-04-08 20:18:09 +00:00
Chris Lattner
0d4858a4eb
Eliminate explicit use of Writer library, using debug dump output instead.
...
llvm-svn: 2147
2002-04-07 22:31:23 +00:00
Chris Lattner
62b7fd136e
Change references to the Method class to be references to the Function
...
class. The Method class is obsolete (renamed) and all references to it
are being converted over to Function.
llvm-svn: 2144
2002-04-07 20:49:59 +00:00
Chris Lattner
e2f2f54f0c
s/MethodType/FunctionType
...
llvm-svn: 2115
2002-04-04 22:19:18 +00:00
Chris Lattner
a8bef43fbb
PATypeHolder is now not a template
...
llvm-svn: 2106
2002-04-04 19:24:34 +00:00
Chris Lattner
1ec764b309
Allow scalars that point to multiple nodes when building the scalar map.
...
llvm-svn: 2087
2002-04-01 01:26:53 +00:00
Chris Lattner
cf09a2a2cd
Add extra case here to avoid getting spurious output
...
llvm-svn: 2086
2002-04-01 00:45:33 +00:00
Chris Lattner
0dc225cbf6
Add debug output
...
llvm-svn: 2066
2002-03-31 07:17:46 +00:00
Chris Lattner
847b6e2ee7
* Catch and ignore (for now) return instructions in tranformed functions
...
* Add more debugging output
* Fix problems refering to wrong versions of various graphs
* Build the pool descriptor map!
* Clear the nodemapping map after building pool descriptor to avoid assert
* Transform the NEw function body, not the old one...
* Matrix.ll now works!
llvm-svn: 2058
2002-03-30 20:53:14 +00:00
Chris Lattner
ca9f4d39f3
* Clean up data structures [AllocDSNode -> DSNode]
...
* TransformFunctionInfo now has call field form field mapping. May be
removed in the future.
* Moved the computation of "Scalars" into transformFunctionBody so
transformFunction didn't have to recompute it.
* Implement the node mapping calculation in preparation to calculate
PoolDescriptors to pass to transformFunctionBody
* Print out the node mapping [it looks right!]
* Other minor changes
llvm-svn: 2056
2002-03-30 09:12:35 +00:00
Chris Lattner
396d5d7c62
Maintain enough information so that the pools for all of the nodes of
...
the graph can be passed around.
llvm-svn: 2053
2002-03-30 04:02:31 +00:00
Chris Lattner
f32d65d5ca
Implement the first batch of transformations to the methods. So far it:
...
* Converts malloc instructions to poolalloc
* Converts free instructions to poolfree
* Convert calls to call the new cloned hacked up versions
Note that this does not modify hacked up stuff yet, just the top level
function
llvm-svn: 2052
2002-03-29 21:25:19 +00:00
Chris Lattner
291a1b1eb2
Correctly clone the function with the extra argument types. Now we need
...
to modify the function next.
This also properly recycles functions so that we don't get exponential
code blowup in the common case.
llvm-svn: 2049
2002-03-29 19:05:48 +00:00
Chris Lattner
f50cffce10
s/Method/Function
...
llvm-svn: 2048
2002-03-29 19:04:45 +00:00
Chris Lattner
16bfdb5f02
New clone function routine
...
llvm-svn: 2045
2002-03-29 19:03:54 +00:00
Chris Lattner
692ad5d9bd
Find out which calls in the function we need to transform and how.
...
Next step is to start hacking functions up.
llvm-svn: 2044
2002-03-29 17:13:46 +00:00
Chris Lattner
15deaa0ab9
s/Method/Function
...
llvm-svn: 2043
2002-03-29 17:08:29 +00:00
Chris Lattner
66df97d436
Modularize code a bit
...
llvm-svn: 2040
2002-03-29 06:21:38 +00:00
Chris Lattner
e0618ca2bd
Implement the first step of pool allocation - Creating, initialization, and
...
destruction of the pools.
llvm-svn: 2039
2002-03-29 05:50:20 +00:00
Chris Lattner
91db58298a
s/Method/Function
...
llvm-svn: 2034
2002-03-29 03:44:36 +00:00
Chris Lattner
c46dcca220
Simplify code a bit by using Module::getOrInsertFunction
...
llvm-svn: 2032
2002-03-29 03:43:24 +00:00
Chris Lattner
175f37c47b
Flesh out a bunch more code, print allocations that are poolable.
...
llvm-svn: 2031
2002-03-29 03:40:59 +00:00
Chris Lattner
ca1500607e
s/method/function
...
llvm-svn: 2030
2002-03-29 03:40:25 +00:00
Chris Lattner
870b1a2799
s/Method/Function/g
...
llvm-svn: 2029
2002-03-29 03:39:36 +00:00
Chris Lattner
c13563d5c0
Simplify code a lot by using the Module::getFunction & getOrInsertFunction
...
llvm-svn: 2028
2002-03-29 03:38:05 +00:00
Chris Lattner
64fd935489
Initial checkin of Noop pass that will be the pool allocator
...
llvm-svn: 2014
2002-03-28 18:08:31 +00:00
Cameron Buschardt
fea5661d49
* Move classes around
...
* rename constructor function
* Move stuff into anonymous namespaces
llvm-svn: 2007
2002-03-27 23:28:40 +00:00
Cameron Buschardt
baef5b2ee2
Implemented promote mem->reg pass.
...
llvm-svn: 2005
2002-03-27 23:17:37 +00:00
Chris Lattner
57698e2c0b
Change references from Method to Function
...
change references from MethodARgument to FunctionArgument
llvm-svn: 1991
2002-03-26 18:01:55 +00:00
Vikram S. Adve
e583c40316
Moved to directory Scalar/ and renamed.
...
llvm-svn: 1977
2002-03-24 03:55:06 +00:00
Vikram S. Adve
1ee0658a07
Major overhaul to support arbitrary mixed array and structure indices.
...
Also moved to the Scalar/ directory and renamed to "MultiDim".
llvm-svn: 1961
2002-03-24 03:21:18 +00:00
Chris Lattner
4e8c4877aa
Rename Method to Function
...
llvm-svn: 1957
2002-03-23 22:51:58 +00:00
Vikram S. Adve
5d218dff24
New pass to decompose multi-dimensional array references into
...
a sequence of 1-D references, using a sequence of getElementPtrs.
llvm-svn: 1948
2002-03-23 20:43:39 +00:00
Chris Lattner
b39971dfa8
Fix bug test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise3.ll
...
llvm-svn: 1943
2002-03-21 23:02:37 +00:00
Chris Lattner
dc960a6d4d
Fix test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise2.ll
...
llvm-svn: 1941
2002-03-21 22:39:59 +00:00
Chris Lattner
50f08078e6
Fix test/Regression/Other/2002-03-21-LevelRaiseMiss.ll
...
llvm-svn: 1933
2002-03-21 21:21:13 +00:00
Chris Lattner
06707765fa
Make ConvertableToGEP handle cases where the user is indexing into the
...
first element of a structure type. Before this would not be handled because
getStructOffset would either stop immediately (because StopEarly was true
and Offset = 0), or blast past the level we wanted.
Now ConvertableToGEP steps down through the type one level at a time, checking
the Offset and Scale conditions at each step
llvm-svn: 1931
2002-03-21 06:27:20 +00:00
Chris Lattner
b874cd9560
Implement the new InsertInstBeforeInst function
...
llvm-svn: 1930
2002-03-21 06:24:00 +00:00
Chris Lattner
0d984ef719
Fix the: test/Regression/Other/2002-03-20-LevelRaiseCrash.ll bug. It turned
...
out that almost always the result of the add was the same as the GEP that
would be generated. In this case, however, it wasn't, so bad things happened.
llvm-svn: 1929
2002-03-21 06:22:23 +00:00
Chris Lattner
14d5ae1ac5
Declare the new InsertInstBeforeInst function
...
llvm-svn: 1927
2002-03-21 06:15:53 +00:00
Chris Lattner
f6c6be2891
1. Fix bug test/Regression/Other/2002-03-20-LevelRaiseBadCodegen.ll
...
2. Allow negative scales in ConvertableToGEP, so that this loop from
alloc_tree in the Olden health benchmark is correctly raised:
for (i = 3; i >= 0; i--)
fval[i] = alloc_tree(level - 1, label*4 + i + 1, new);
Stepping through the array backwards caused a negative scale.
llvm-svn: 1922
2002-03-21 03:04:38 +00:00
Chris Lattner
14fe4c60d4
Namespace qualify debugging code
...
llvm-svn: 1921
2002-03-21 03:02:07 +00:00
Vikram S. Adve
9f129ffe56
Just a comment.
...
llvm-svn: 1908
2002-03-18 03:40:25 +00:00
Vikram S. Adve
98a0150582
New pass to decompose multi-dimensional array references into
...
a sequence of 1-D references, using a sequence of getElementPtrs.
llvm-svn: 1907
2002-03-18 03:39:09 +00:00
Chris Lattner
205373ff74
Remove code designed to compensate for a bug in GCC. The bug has since
...
been fixed.
llvm-svn: 1881
2002-03-15 20:35:21 +00:00
Chris Lattner
60ab10bbef
Cleanup error message output a bit
...
llvm-svn: 1879
2002-03-15 20:21:29 +00:00
Chris Lattner
4ca6cd403f
Fix bug: test/Regression/Other/2002-03-14-LevelRaiseHang.ll
...
llvm-svn: 1869
2002-03-14 16:37:04 +00:00
Chris Lattner
bee86626e1
Fix bug: test/Regression/Other/2002-03-11-InstCombineHang.ll
...
llvm-svn: 1864
2002-03-11 23:28:45 +00:00
Chris Lattner
7e91634005
update comments
...
llvm-svn: 1862
2002-03-11 22:21:04 +00:00
Chris Lattner
7287d698bf
* Fix bug: test/Regression/Other/2002-03-11-LevelRaiseIterInvalidate.ll
...
* Use more concise form of ReplaceInstWithInst to make code simpler
* Output nicer message for dead code eliminated when debugging
llvm-svn: 1861
2002-03-11 22:19:48 +00:00
Chris Lattner
477fe0845a
Fix bug: test/Regression/Other/2002-03-11-ConstPropCrash.ll
...
llvm-svn: 1858
2002-03-11 22:11:07 +00:00
Chris Lattner
7fd7b30727
Fix bug: test/Regression/Other/2002-03-11-LevelRaiseCalls.ll
...
llvm-svn: 1844
2002-03-11 17:27:34 +00:00
Chris Lattner
d7789cb819
We were not correctly burrowing down multiple levels to get to a leaf. Fix this now
...
llvm-svn: 1833
2002-03-07 21:18:00 +00:00
Chris Lattner
717dba9474
Support changing the pointer type of a store for the case where we are
...
storing into the first element of the structure type.
llvm-svn: 1832
2002-03-07 21:17:35 +00:00
Chris Lattner
8032732948
Take CallGraph out of the CFG namespace. It has nothing to do with CFGs
...
llvm-svn: 1820
2002-03-06 17:16:43 +00:00
Chris Lattner
04805fa29c
Change over to use new style pass mechanism, now passes only expose small
...
creation functions in their public header file, unless they can help it.
llvm-svn: 1816
2002-02-26 21:46:54 +00:00
Chris Lattner
d209550828
Move ProfilePaths class into ProfilePaths library, only expose a creation function
...
llvm-svn: 1812
2002-02-26 20:04:59 +00:00
Chris Lattner
570b8e1da8
Pass stuff by reference instead of by copy. Copying entire graphs seems like
...
a bad idea
llvm-svn: 1810
2002-02-26 19:49:45 +00:00
Chris Lattner
18ff945065
Move processGraph down lower in the file so all of the forward declarations
...
can be eliminated.
llvm-svn: 1809
2002-02-26 19:43:49 +00:00
Chris Lattner
5328c6fd97
* Changes to compile successfully with GCC 3.0
...
* Eliminated memory leak in processGraph
* Pass vectors by const reference to moveDummyCode instead of by copy
llvm-svn: 1808
2002-02-26 19:40:28 +00:00
Anand Shukla
a9b9636aca
Makefile for profile-paths
...
llvm-svn: 1807
2002-02-26 19:36:43 +00:00
Anand Shukla
854c302594
Initial checkin: functions on Graph used for path profile pass
...
llvm-svn: 1806
2002-02-26 19:02:16 +00:00
Anand Shukla
70a61383eb
Initial checkin: instrument code to get path execution frequency
...
llvm-svn: 1805
2002-02-26 19:00:48 +00:00
Anand Shukla
d0f8c88e91
Initial checkin: helper file to insert instrumentation code along edges
...
llvm-svn: 1804
2002-02-26 18:59:46 +00:00
Anand Shukla
d3d1fcd08d
Initial check in of graph.cpp: implements graph interface used in path profiles
...
llvm-svn: 1803
2002-02-26 18:58:39 +00:00
Anand Shukla
61a1c1ee56
New makefile to include ProfilePaths dir
...
llvm-svn: 1799
2002-02-26 18:20:27 +00:00
Chris Lattner
f20671a6b6
When inlining basic blocks and instructions, give them a name!
...
llvm-svn: 1796
2002-02-25 00:31:02 +00:00
Chris Lattner
93a0341dbf
Namespaces
...
llvm-svn: 1791
2002-02-24 23:03:09 +00:00
Chris Lattner
ccb9e604de
Handle more cases in the linker
...
llvm-svn: 1771
2002-02-18 19:05:15 +00:00
Chris Lattner
4ed4caf44a
Bug fix for test/Regression/Other/2002-02-14-LevelRaiseBadAssert.ll
...
llvm-svn: 1767
2002-02-14 22:21:40 +00:00
Chris Lattner
aca1090da2
Implement conversion of method pointer parameter in Call instruction
...
to clean up MST benchmark.
llvm-svn: 1763
2002-02-14 19:44:09 +00:00
Chris Lattner
a5ee9139ba
* Check in fix for: llvm/test/Regression/Other/2002-02-14-LevelRaiseInstDelete.ll
...
* Minor reformatting.
llvm-svn: 1760
2002-02-14 18:55:22 +00:00
Chris Lattner
83d485b310
* Pull BasicBlock::pred_* and BasicBlock::succ_* out of BasicBlock.h and into
...
llvm/Support/CFG.h
* Make pred & succ iterators for intervals global functions
* Add #includes that are now neccesary because BasicBlock.h doesn't include
InstrTypes.h anymore
llvm-svn: 1750
2002-02-12 22:39:50 +00:00
Chris Lattner
60a6591d83
Method.h no longer includes BasicBlock.h
...
Method::inst_* is now in llvm/Support/InstIterator.h
GraphTraits specializations for BasicBlock and Methods are now in llvm/Support/CFG.h
llvm-svn: 1746
2002-02-12 21:07:25 +00:00
Chris Lattner
429a20af4c
Add neccesary #include
...
llvm-svn: 1742
2002-02-12 20:19:06 +00:00
Chris Lattner
50a45782ec
I forgot to provide dominance frontier information. Now it's available.
...
Also add more comments.
llvm-svn: 1741
2002-02-12 18:27:41 +00:00
Chris Lattner
12f155a6f0
Initial checkin of new memory -> register promotion pass
...
llvm-svn: 1739
2002-02-12 17:16:22 +00:00
Chris Lattner
86595ae342
General cleanup
...
llvm-svn: 1628
2002-02-01 04:53:48 +00:00
Chris Lattner
f9f2896c48
Eliminate SimplifyCFG.h file, pull everything into the UnifyMethodExitNodes class
...
llvm-svn: 1613
2002-01-31 01:12:06 +00:00
Chris Lattner
352151e222
MethodPass's are now guaranteed to not be run on external methods!
...
llvm-svn: 1611
2002-01-31 00:51:24 +00:00
Chris Lattner
d5d56780e2
Convert xforms over to new pass structure.
...
llvm-svn: 1605
2002-01-31 00:45:11 +00:00
Chris Lattner
ccf571a408
Convert analyses to new pass structure
...
llvm-svn: 1603
2002-01-31 00:42:27 +00:00
Chris Lattner
d5851db315
Remove extraneous #includes
...
llvm-svn: 1588
2002-01-26 22:47:32 +00:00
Chris Lattner
7209dc2446
Remove opt namespace
...
llvm-svn: 1587
2002-01-26 22:47:07 +00:00
Chris Lattner
ccbd4e4643
Implement new DeadInstElmination pass
...
remove old comment
llvm-svn: 1555
2002-01-23 05:48:24 +00:00
Chris Lattner
70090079e7
Don't insert a useless cast
...
llvm-svn: 1527
2002-01-22 03:30:06 +00:00
Chris Lattner
3787ee6be6
Rename LowerAllocations.h to ChangeAllocations.h since it now contains the
...
RaiseAllocations pass as well.
llvm-svn: 1525
2002-01-22 01:04:08 +00:00
Chris Lattner
4f0f09757d
Pull RaiseAllocations stuff out of the CleanGCC pass into it's own pass in
...
the ChangeAllocations.h header file.
llvm-svn: 1522
2002-01-22 00:13:51 +00:00
Chris Lattner
d07471d6c3
LowerAllocations is really a BasicBlock pass. Make it so.
...
llvm-svn: 1521
2002-01-21 23:34:02 +00:00
Chris Lattner
ee965abc36
Move stuff out of the Optimizations directories into the appropriate Transforms
...
directories. Eliminate the opt namespace.
llvm-svn: 1520
2002-01-21 23:17:48 +00:00
Chris Lattner
8cc83611e6
Elminate an unused variable
...
llvm-svn: 1518
2002-01-21 23:16:30 +00:00
Chris Lattner
c940c536ab
Rename SwapStructureContents -> IPO/SimpleStructMutation
...
Move MutateStructTypes.(cpp|h) -> IPO/MutateStructTypes.(cpp|h)
llvm-svn: 1510
2002-01-21 07:52:35 +00:00
Chris Lattner
0686e435d1
Implement a more powerful, simpler, pass system. This pass system can figure
...
out how to run a collection of passes optimially given their behaviors and
charactaristics.
Convert code to use it.
llvm-svn: 1507
2002-01-21 07:31:50 +00:00
Chris Lattner
7f74a56e24
Changes to build successfully with GCC 3.02
...
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Chris Lattner
ca081257e5
initial checkin
...
llvm-svn: 1480
2001-12-14 16:52:21 +00:00
Chris Lattner
3655cfb4e2
* isFirstClassType is now provided by the Type class
...
* Add ReplaceInstWithInst
llvm-svn: 1468
2001-12-14 16:39:22 +00:00
Chris Lattner
9dedd32ff4
* add ReplaceInstWithInst
...
* Add support for pointer indexing
* Fix minor bugs that are majorly annoying
llvm-svn: 1467
2001-12-14 16:38:59 +00:00
Chris Lattner
b3364fc169
Remove unsized array support
...
llvm-svn: 1466
2001-12-14 16:38:04 +00:00
Chris Lattner
b457653c6f
* Support pointer indexing
...
* Unsized arrays are a thing of the past, remove DoInsertArrayCast family
* Remove cases were we would get into infinite loops because we would insert a cast
which would then be removed, inserting a different cast, ad infinitum...
* Remove some code that should be redundant with ExprTypeConvert code
llvm-svn: 1465
2001-12-14 16:37:52 +00:00
Chris Lattner
3e88b44afc
Many many changes and bugfixes:
...
* Remove support for unsized arrays
* Add pointer indexing support
* Allow more arbitrary malloc type changes (which are too generous currently
and should be fixed in the future)
* Allow more and better conversions
llvm-svn: 1464
2001-12-14 16:35:53 +00:00
Chris Lattner
11439b2360
The proper prototype for malloc returns a pointer, not an unsized array
...
llvm-svn: 1463
2001-12-14 16:32:20 +00:00
Chris Lattner
f1197b0d43
* Refactor trace values to work as a proper pass. Before it used to add
...
methods while the pass was running which was a no no. Now it adds the
printf method at pass initialization
* Revamp code to use printf calls instead of the old style print_<type>
calls.
* Simplify code
llvm-svn: 1457
2001-12-14 16:26:05 +00:00
Chris Lattner
f5c6f65e7f
Assertion could never fail because another one would in it's place. :)
...
llvm-svn: 1449
2001-12-13 00:45:40 +00:00
Chris Lattner
e51379766b
Implement more general conversions for getelementptr instructions
...
llvm-svn: 1432
2001-12-07 04:40:30 +00:00
Chris Lattner
dae4d63ddf
Remove code that is superceeded by code in ExprTypeConvert.cpp
...
llvm-svn: 1431
2001-12-07 04:39:01 +00:00
Chris Lattner
72da4460b3
Don't insert scales of 1 :)
...
llvm-svn: 1430
2001-12-07 04:26:02 +00:00
Chris Lattner
71ffba7b70
We can do cast-add elimination even on casts that reinterpret
...
llvm-svn: 1427
2001-12-06 18:06:13 +00:00
Chris Lattner
b1995e1e69
Fix bug that caused invalid transformations to be applied
...
llvm-svn: 1426
2001-12-06 18:05:55 +00:00
Chris Lattner
674394077f
Actually return true when a change has been made
...
llvm-svn: 1425
2001-12-05 19:41:33 +00:00
Chris Lattner
8d16760c21
Handle more complex array indexing expressions
...
llvm-svn: 1424
2001-12-05 19:41:16 +00:00
Chris Lattner
1d244625c0
Fix pessimizations on sized arrays
...
llvm-svn: 1423
2001-12-05 19:40:32 +00:00
Chris Lattner
ad08d2fd8e
Fix a few bugs. Fix pessimization handling sized arrays
...
llvm-svn: 1422
2001-12-05 19:39:15 +00:00
Chris Lattner
cd7fb504a5
Hrm, don't do debugging output when debugging is off. :(
...
llvm-svn: 1420
2001-12-05 06:40:17 +00:00
Chris Lattner
617aaaad86
Fixes to type conversion stuff to match induction variables more frequently
...
llvm-svn: 1417
2001-12-05 06:34:00 +00:00
Chris Lattner
25b151dfdf
Fix a bug introduced by "internal linkage" work.
...
llvm-svn: 1415
2001-12-04 18:01:49 +00:00
Chris Lattner
d23d752dc5
Fix bugs, don't do external methods which causes segv.
...
llvm-svn: 1414
2001-12-04 08:13:06 +00:00
Chris Lattner
4c160c39b4
Remove printouts
...
llvm-svn: 1413
2001-12-04 08:12:53 +00:00
Chris Lattner
91daaabb56
Implement induction variable simplification
...
llvm-svn: 1411
2001-12-04 04:32:29 +00:00
Chris Lattner
2413b160ec
Renamed inst_const_iterator -> const_inst_iterator
...
Renamed op_const_iterator -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()
llvm-svn: 1408
2001-12-04 00:03:30 +00:00
Chris Lattner
3462ae3ad7
Rename ConstPoolVal -> Constant
...
Rename ConstPool* -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h
llvm-svn: 1407
2001-12-03 22:26:30 +00:00
Chris Lattner
fb5ae02e1a
Split the PHINode class out from the iOther.h file into the iPHINode.h file
...
llvm-svn: 1405
2001-12-03 18:02:31 +00:00
Chris Lattner
476e6df794
Initial checkin of indvar stuff
...
llvm-svn: 1404
2001-12-03 17:28:42 +00:00
Chris Lattner
f55d8013d9
Compile the scalar directory
...
llvm-svn: 1403
2001-12-03 17:28:15 +00:00
Chris Lattner
5de2204fe8
Create a new #include "Support/..." directory structure to move things
...
from "llvm/Support/..." that are not llvm dependant.
Move files and fix #includes
llvm-svn: 1400
2001-11-27 00:03:19 +00:00
Chris Lattner
54d5928569
Turn off debug info
...
llvm-svn: 1396
2001-11-26 19:36:58 +00:00
Chris Lattner
302014f2e7
Make strings be internal
...
llvm-svn: 1384
2001-11-26 19:14:33 +00:00
Chris Lattner
1416a2992e
Remove debugging output
...
llvm-svn: 1383
2001-11-26 19:14:16 +00:00
Chris Lattner
4219baafb5
Support internal linkage
...
llvm-svn: 1382
2001-11-26 19:14:03 +00:00
Chris Lattner
660c2f0e6f
Build IPO directory
...
llvm-svn: 1381
2001-11-26 18:59:30 +00:00
Chris Lattner
22fd21ed16
Implement support for internal methods
...
llvm-svn: 1380
2001-11-26 18:59:18 +00:00
Chris Lattner
ee568eb459
Include const prop as part of -raise
...
llvm-svn: 1379
2001-11-26 18:58:55 +00:00
Chris Lattner
c4ad64cb9c
Misc cleanups
...
llvm-svn: 1377
2001-11-26 18:57:38 +00:00
Chris Lattner
1f86880af4
Expose constant propogation of an instruction in a clean way
...
llvm-svn: 1376
2001-11-26 18:57:12 +00:00
Chris Lattner
bd422e6686
Implement DCE of global values
...
llvm-svn: 1360
2001-11-26 18:42:17 +00:00
Chris Lattner
330dc57305
Support array indexing
...
llvm-svn: 1345
2001-11-26 17:00:43 +00:00
Chris Lattner
c43c461ca6
Support Composite's, not just structs
...
llvm-svn: 1344
2001-11-26 17:00:13 +00:00
Chris Lattner
03386ec88b
losslessCastableTypes is moved to Type class
...
getStructOffsetType supports array indexing
llvm-svn: 1343
2001-11-26 16:59:47 +00:00
Chris Lattner
2cc6d418fa
Support selectable structure transformations
...
llvm-svn: 1342
2001-11-26 16:59:10 +00:00
Chris Lattner
f80013a917
Support mutation of array indexing
...
llvm-svn: 1341
2001-11-26 16:58:33 +00:00
Chris Lattner
f9378e7d2d
Clean up code, implement array indexing stuff
...
llvm-svn: 1340
2001-11-26 16:58:14 +00:00
Chris Lattner
1df615c834
Implement array indexing reverse engineering
...
llvm-svn: 1339
2001-11-26 16:57:31 +00:00
Vikram S. Adve
b601fda7ce
Print incoming arguments and return values.
...
llvm-svn: 1315
2001-11-15 15:00:16 +00:00
Chris Lattner
02c43c8609
-cleangcc pass now remove type names that are never referenced and type names for pointers to primitive types.
...
llvm-svn: 1312
2001-11-15 04:34:46 +00:00
Chris Lattner
1237e86597
Remove much cruft from the MemAccessInst instruction
...
llvm-svn: 1298
2001-11-14 11:27:58 +00:00
Chris Lattner
abf40ba6e8
Better heuristics for handling arrays
...
llvm-svn: 1296
2001-11-14 11:02:49 +00:00
Chris Lattner
0cd962fa61
* Change ExpressionConvertableToType to more closely match map behavior of
...
ConvertExpressionToType
* Make ValueHandle's remove instruction from maps when they are deleted so that
no false map hits occur if a subsequent instruction is allocated to the same
space in memory. This was a VERY VERY VERY EVIL NASTY BUG to track down. :-P
llvm-svn: 1288
2001-11-13 05:01:36 +00:00
Chris Lattner
4f8e9468cb
Avoid assertion failure when taking size of unsized array. Todo item herE
...
llvm-svn: 1286
2001-11-13 04:59:41 +00:00
Chris Lattner
1643e8ec7b
Fix minor bug
...
llvm-svn: 1273
2001-11-12 20:13:04 +00:00
Ruchira Sasanka
cc3da8c107
Changed insert instructions only for CONSTANTS - back to original
...
llvm-svn: 1271
2001-11-12 19:32:04 +00:00
Chris Lattner
49ec72411e
Initail checking of structure swapper
...
llvm-svn: 1248
2001-11-10 07:28:25 +00:00
Chris Lattner
5dada09565
Initial checkin of structure mutator
...
llvm-svn: 1246
2001-11-10 07:26:31 +00:00
Chris Lattner
0043cc1109
Remove false optimization that basically broke everything
...
llvm-svn: 1219
2001-11-09 01:08:10 +00:00
Chris Lattner
54e9f453c9
* Add better caching of data to avoid silly recusions
...
* Only check to see if uses of instructions can be converted for expressions... so we don't look at all of the uses of a constant. This was making the code unnecessarily conservative
llvm-svn: 1218
2001-11-08 22:06:31 +00:00
Chris Lattner
583e95e0b2
Improve raising significantly
...
llvm-svn: 1214
2001-11-08 20:19:56 +00:00
Vikram S. Adve
3b193679f0
Bug fix: cannot modify Phi operands while iterating over them!
...
llvm-svn: 1203
2001-11-08 05:25:33 +00:00
Chris Lattner
3b7199e36c
Add #includes to enable buiding in Release mode
...
llvm-svn: 1174
2001-11-07 13:49:45 +00:00
Chris Lattner
6c4681ca28
Fix minor bug for shifts
...
llvm-svn: 1160
2001-11-06 21:51:48 +00:00
Chris Lattner
0136101e37
Fix bugs
...
llvm-svn: 1152
2001-11-06 08:34:29 +00:00
Chris Lattner
4031cdde57
Fix many bugs. Implement PHI transforms & other cycles
...
llvm-svn: 1151
2001-11-06 08:34:17 +00:00
Chris Lattner
710c3861b5
Fix bug with ADD nodes and malloc promotion
...
llvm-svn: 1144
2001-11-05 21:13:30 +00:00
Chris Lattner
7e89a616e6
Don't print spurious linking warnings about methods that are never used.
...
Cleanup ExprTypeConvert a bit.
llvm-svn: 1141
2001-11-05 19:43:10 +00:00
Chris Lattner
0ecba60d26
Use the expression map correctly.
...
llvm-svn: 1140
2001-11-05 18:30:53 +00:00
Chris Lattner
db750679a3
New file for expression tree conversion
...
llvm-svn: 1128
2001-11-04 23:24:20 +00:00
Chris Lattner
3084cb65ff
Refactor code to share stuff
...
llvm-svn: 1127
2001-11-04 23:24:06 +00:00
Chris Lattner
cb3da314d9
* Relax restriction that prevented malloc promotion in certain cases
...
llvm-svn: 1125
2001-11-04 22:11:10 +00:00
Chris Lattner
36c5a79153
* Disable debug output
...
* fix minor bug with taking datasize of unsized array type
* Insert code to support speculative changes later
llvm-svn: 1122
2001-11-04 21:32:11 +00:00
Chris Lattner
40a2d9076b
Convert backward conversion of expression trees into a new more powerful bidirectional approach. Add transforms for more instructions.
...
llvm-svn: 1121
2001-11-04 20:21:12 +00:00
Chris Lattner
33d9cb9903
Minor method rename
...
llvm-svn: 1119
2001-11-04 08:08:34 +00:00