Chris Lattner
c43b279e94
Remove unneccesary cast
...
llvm-svn: 2269
2002-04-16 21:36:29 +00:00
Chris Lattner
10c22c6970
Changes to:
...
* Fix bug printing method types (oops when converting previous code)
* Move some of the code from Constant::getStrValue implementations here.
This allows us to do a MUCH MUCH better job printing out complex constant
values (think an array of structure pointers), because we print symbolic
type names instead of structural. The assistance when debugging is immense
Eventually, Constant::getStrValue should be removed (it existed before because
the asmwriter file was not in VMCore), and everyone should go through the
asmwriter that want's equivalent functionality.
llvm-svn: 2268
2002-04-16 21:36:08 +00:00
Chris Lattner
0cda7182ba
* Remove the concept of a critical shadow node
...
* Make the function pointer argument explicit for a call nodes
* Eliminate unreachable global values
* Merge call nodes that are identical
llvm-svn: 2266
2002-04-16 20:39:59 +00:00
Chris Lattner
11f9ff83ec
* Eliminate ArgDSNode's completely, now rely on scalar map
...
* Fold call nodes that are indistinguishable for each other. This is a big
win for external functions like sqrt, which would multiply dramatically
before.
* Global nodes with no edges to or from them are now eliminated from the graph.
llvm-svn: 2257
2002-04-16 03:44:03 +00:00
Chris Lattner
c004e8f534
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
9799e40136
Only print debug message if DEBUG_RA is on
...
llvm-svn: 2254
2002-04-15 22:41:48 +00:00
Chris Lattner
572d298aa6
Only emit message if DEBUG_RA is on
...
llvm-svn: 2252
2002-04-15 20:36:15 +00:00
Chris Lattner
1923a5cfaa
Eliminate cast of same type instructions.
...
llvm-svn: 2251
2002-04-15 19:45:29 +00:00
Chris Lattner
2e20403fad
* 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
983272ba58
Turn off debug output
...
llvm-svn: 2247
2002-04-14 06:14:41 +00:00
Chris Lattner
3b7f72e4e4
* 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
0bc26610af
* Fix bug: test/Regression/Verifier/2002-04-13-RetTypes.ll
...
* Check that arguments match the method types of the method they live in
llvm-svn: 2243
2002-04-13 22:48:46 +00:00
Chris Lattner
c0505e8d4e
Minor bugfix for previous checkin
...
llvm-svn: 2241
2002-04-13 21:11:04 +00:00
Chris Lattner
5496a44cc2
* Remove obselete code for unsized arrays
...
* Add new function printTypeAtLeastOneLevel used to...
* Print the symbol table *WITH SYMBOLIC TYPES*. Now we get:
%tree = type { int, %tree*, %tree* }
in the type definition section of the disassembled output instead of
%tree = type { int, \2*, \2* }
the different for the health benchmark and power are simply amazing.
llvm-svn: 2240
2002-04-13 20:53:41 +00:00
Chris Lattner
47b17915d5
* 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
249f5243f1
* 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
92b32c82bf
Add Module::getTypeName
...
llvm-svn: 2237
2002-04-13 18:58:33 +00:00
Chris Lattner
a4bce481d6
* Clean up code to use isa & dyncast instead of poking directly into instructions
...
* Do not print the allocation size for a non array allocation (this used to work,
but was broken).
llvm-svn: 2235
2002-04-13 18:34:38 +00:00
Chris Lattner
24f4497fe9
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
d1d6edad49
* Add comment
...
* Do not print a space before the * in a pointer type.
llvm-svn: 2232
2002-04-12 18:21:53 +00:00
Chris Lattner
ed2a2c0c57
Add new check of return value type matching ret instruction values types
...
llvm-svn: 2230
2002-04-12 18:20:49 +00:00
Chris Lattner
8584e40a86
Fix pure virtual function called exception!
...
llvm-svn: 2229
2002-04-12 18:19:45 +00:00
Chris Lattner
c9d79fd15f
Handle the FP format problem, where outputed FP constants were not precise
...
enough. This fixes compilation of the health benchmark.
llvm-svn: 2228
2002-04-11 21:44:02 +00:00
Chris Lattner
3b04124abd
* 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
866bf47eff
Print out what the root of the call graph is.
...
llvm-svn: 2223
2002-04-10 20:31:44 +00:00
Chris Lattner
150fc89dcd
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
4434e03eb6
Move FunctionArgument out of iOther.h into Argument.h and rename class to
...
be 'Argument' instead of FunctionArgument.
llvm-svn: 2217
2002-04-09 19:59:31 +00:00
Chris Lattner
5e12c7caf5
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
7186b402ec
Eliminate unneccesary extraneous iterators
...
llvm-svn: 2215
2002-04-09 19:46:27 +00:00
Chris Lattner
74e29d9b61
Move FunctionArgument out of iOther.h into Argument.h and rename class to
...
be 'Argument' instead of FunctionArgument.
Rename some yacc type names to be more concise. Change jump table to use
a vector instead of a list.
llvm-svn: 2214
2002-04-09 19:41:42 +00:00
Chris Lattner
a5c460d052
Update comment to reflect class name change.
...
llvm-svn: 2213
2002-04-09 19:40:40 +00:00
Chris Lattner
37a1b36f0a
Move FunctionArgument out of iOther.h into Argument.h and rename class to
...
be 'Argument' instead of FunctionArgument.
Move implementation to Function.cpp
llvm-svn: 2212
2002-04-09 19:39:58 +00:00
Chris Lattner
0eb1e7c044
Move FunctionArgument out of iOther.h into Argument.h and rename class to
...
be 'Argument' instead of FunctionArgument.
Move Argument implementation to Function.cpp
llvm-svn: 2211
2002-04-09 19:39:35 +00:00
Chris Lattner
b2038512b2
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
7ae20d642d
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
bcca3f108e
Add a couple of extra casts to avoid extra #include
...
llvm-svn: 2206
2002-04-09 18:37:08 +00:00
Chris Lattner
b579d93f7f
Add a couple of extra casts to avoid having to add #include
...
llvm-svn: 2205
2002-04-09 18:36:52 +00:00
Chris Lattner
fb97e6628c
iUse new form of pop_back to make code more concise
...
llvm-svn: 2202
2002-04-09 18:02:02 +00:00
Chris Lattner
97ce718b8d
No need to reserve space, erasing does not change the size of the container.
...
llvm-svn: 2201
2002-04-09 18:01:21 +00:00
Chris Lattner
3557e076c5
Delete NOP instructions as they are eliminated.
...
llvm-svn: 2199
2002-04-09 15:05:04 +00:00
Chris Lattner
119c675af7
* Add a file header with some information
...
* Delete the DelaySlotInfo objects created by the SchedulingManager class.
These leaked objects were accounting for 3/4 of the memory leaked by the
backend, so this is a relatively major win.
* Reorganize SchedulingManager::getDelaySlotInfoForInstr so that it has
better code locality (making it easier to read).
llvm-svn: 2197
2002-04-09 05:45:58 +00:00
Chris Lattner
0a8a112014
Don't leak all of the Loop objects created...
...
llvm-svn: 2196
2002-04-09 05:43:19 +00:00
Chris Lattner
dbc90d1c0c
* Add a useful file comment
...
* Move InsertPrologEpilogCode class to PrologEpilogCodeInserter.cpp
-> Among other things, this eliminates the need for the minstrVec static
global array.
llvm-svn: 2195
2002-04-09 05:21:26 +00:00
Chris Lattner
259b748661
Move the InsertPrologEpilogCode class out of the Sparc.cpp file into the
...
new PrologEpilogCodeInserter.cpp file, and include the bodies of the
GetInstructionsFor(Prolog|Epilog) functions from SparcInstrSelection.cpp
into the class. This eliminates the need for a static global vector of
instructions and a class of errors that is really unneccesary.
llvm-svn: 2194
2002-04-09 05:20:15 +00:00
Chris Lattner
c738b9e631
Move the InsertPrologEpilogCode class out of the Sparc.cpp file, and include
...
the bodies of the GetInstructionsFor(Prolog|Epilog) functions from
SparcInstrSelection.cpp into the class. This eliminates the need for a static
global vector of instructions and a class of errors that is really unneccesary.
llvm-svn: 2193
2002-04-09 05:18:31 +00:00
Chris Lattner
2a77170587
Include prototype for interface to PrologEpilogCodeInserter.cpp file
...
llvm-svn: 2192
2002-04-09 05:16:36 +00:00
Chris Lattner
5db83c9e2e
Use new higher level isFloatingPoint() function
...
llvm-svn: 2191
2002-04-09 05:16:08 +00:00
Chris Lattner
cd23d94446
Clean up the ownership model a bit so that nodes actually get deleted more
...
frequently. This still leaks edges quite a bit, but it leaks no nodes
(I think).
llvm-svn: 2190
2002-04-09 05:15:33 +00:00
Chris Lattner
5f86cf1a1c
* General cleanups
...
* In calcLiveVarSetsForBB, do not leak a ValueSet every time the function
is called!
llvm-svn: 2189
2002-04-09 05:14:14 +00:00
Chris Lattner
ee0fa0eb15
Convert AddedInstrMapType to contain AddedInstrns by value instead of by
...
pointer so that they do not all get leaked!
llvm-svn: 2188
2002-04-09 05:13:04 +00:00
Chris Lattner
9a2cf06433
*blush* somehow this debugging code got checked in...
...
llvm-svn: 2187
2002-04-09 05:10:39 +00:00
Chris Lattner
7bc600203b
GCC3.0 is reported to die without an alloca definition.
...
llvm-svn: 2186
2002-04-09 03:37:11 +00:00
Chris Lattner
e7a2ce6e4e
Don't leak memory like a seive
...
llvm-svn: 2185
2002-04-08 23:09:07 +00:00
Chris Lattner
56229b8690
Value cannot be directly instantiated. I think that this code was TRYING to
...
make a PHI node, although it was badly broken. This keeps tests passing, so
we'll go with it.
llvm-svn: 2184
2002-04-08 22:05:54 +00:00
Chris Lattner
ba71c8f7e1
Remove extranous #include
...
llvm-svn: 2183
2002-04-08 22:05:10 +00:00
Chris Lattner
c8166cec07
s/Method/Function
...
llvm-svn: 2180
2002-04-08 22:03:57 +00:00
Chris Lattner
5046c084ec
* Narrow AsmWriter interface
...
* Implement Value::print methods here instead of WriteToAssembly
llvm-svn: 2179
2002-04-08 22:03:40 +00:00
Chris Lattner
31e5838296
s/Method/Function
...
Remove extraneous #includes of llvm/Assembly/Writer
llvm-svn: 2178
2002-04-08 22:03:00 +00:00
Chris Lattner
cd3575a5cf
s/method/function
...
llvm-svn: 2177
2002-04-08 22:01:15 +00:00
Chris Lattner
8bfb164f22
llvm/Assembly/Writer.h is unneccesary except for extreme output
...
isLabelType is obsolete
llvm-svn: 2176
2002-04-08 21:59:36 +00:00
Chris Lattner
56e96eb88f
isLabelType is obsolete
...
llvm-svn: 2175
2002-04-08 21:59:08 +00:00
Chris Lattner
0962b63d7c
Play around with #includes
...
llvm-svn: 2174
2002-04-08 21:58:53 +00:00
Chris Lattner
49808e463c
Add #includes that were pruned from already #included files
...
llvm-svn: 2173
2002-04-08 21:56:50 +00:00
Chris Lattner
44f14449c4
ConstantHandling moved into VMCore library
...
llvm-svn: 2165
2002-04-08 20:18:09 +00:00
Chris Lattner
87314d504c
Library bumped up out of Assembly directory
...
llvm-svn: 2164
2002-04-08 20:17:06 +00:00
Chris Lattner
ea46675105
Moved assembly writer library into its own top level directory.
...
llvm-svn: 2162
2002-04-08 19:42:33 +00:00
Chris Lattner
7083f2bcf0
Move include/llvm/ValueHolderImpl.h to lib/VMCore/ValueHolderImpl.h
...
llvm-svn: 2156
2002-04-08 00:15:29 +00:00
Chris Lattner
137fa92dce
* Move include/llvm/Analysis/SlotCalculator.h to include/llvm/SlotCalculator.h
...
because the slot calculator is already part of the VMCore library.
* Rename incorporateMethod and purgeMethod to *Function
llvm-svn: 2154
2002-04-07 22:49:37 +00:00
Chris Lattner
8b16900b1b
Remove asmwriter library from link line, because the useful contents of it
...
have been incorporated into the vmcore library.
llvm-svn: 2153
2002-04-07 22:35:30 +00:00
Chris Lattner
0b712a046b
Remove some gross code by using the Value::dump method to do debug dumps
...
llvm-svn: 2150
2002-04-07 22:33:13 +00:00
Chris Lattner
47f1f0e588
Remove some gross code by using the VAlue::dump method to do debug dumps
...
llvm-svn: 2149
2002-04-07 22:32:25 +00:00
Chris Lattner
c994519230
Update comments
...
Implement Value::dump here.
llvm-svn: 2148
2002-04-07 22:31:46 +00:00
Chris Lattner
0cfa70b083
Eliminate explicit use of Writer library, using debug dump output instead.
...
llvm-svn: 2147
2002-04-07 22:31:23 +00:00
Chris Lattner
bc15ae64dd
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
96135c924f
Fix Bug: test/Regression/Other/2002-04-07-InfConstant.ll
...
llvm-svn: 2142
2002-04-07 08:42:53 +00:00
Chris Lattner
1c83a4a20c
Fix bug: test/Regression/Other/2002-04-07-HexFloatConstants.ll
...
llvm-svn: 2141
2002-04-07 08:37:11 +00:00
Chris Lattner
9dfa62172d
Add a better comment to explain what is going on.
...
llvm-svn: 2139
2002-04-07 08:31:26 +00:00
Chris Lattner
7413f64df2
Remove debugging code accidentally checked in!
...
llvm-svn: 2137
2002-04-07 08:13:29 +00:00
Chris Lattner
c6c7c99011
Add support for hexadecimal FP constants!
...
llvm-svn: 2135
2002-04-07 08:10:41 +00:00
Chris Lattner
e7b5d159c5
Implement constant propogation of multiply and divide instructions!!
...
llvm-svn: 2134
2002-04-07 08:10:14 +00:00
Chris Lattner
d81ca8a752
* Make all of the refineAbstractType functions work identically
...
* Remove ambiguous code that caused problems with understanding how stuff
worked.
* Implement DerivedType::typeIsRefined right. Add a big comment talking
about it.
* The removeUserFromConcrete method already checks to see if the type is
not abstract, so no need to duplicate the test all over this code
This checkin makes all of the type parsing related failures work. All
Assembler Regression tests now pass!
llvm-svn: 2127
2002-04-07 06:14:56 +00:00
Chris Lattner
ff6ec9b552
Enable better debug output. When debugging the type system, print out the
...
type tables after reading a bytecode file to make sure they are ok
llvm-svn: 2126
2002-04-07 06:11:22 +00:00
Chris Lattner
35c1a4347b
* Reenable apparently neccesary code, that breaks testcases when enabled,
...
but causes MANY FUNDAMENTAL PROBLEMS when not enabled. :(
* Add debugging function
llvm-svn: 2125
2002-04-06 00:21:11 +00:00
Chris Lattner
83b6eecc84
* FIX: test/Regression/Assembler/2002-02-19-TypeParsing.ll
...
That was due to the StructType object not getting called multiple times
to remove itself from the ATU list for an object, because it stopped
getting queried due to this wrong test
* Improve debug output when DEBUG_MERGE_TYPES is on
llvm-svn: 2124
2002-04-05 23:02:46 +00:00
Chris Lattner
68857bb2bf
* Move DerivedType::addAbstractTypeUser from DerivedType.h
...
* Refactor a bunch of code. Types now only remove one subelement at a time
when they are told that they have changed
* Improve debugging output, add more assertions...
* FIX Bugs:
* test/Regression/Assembler/2002-04-04-PureVirtMethCall.ll
* test/Regression/Assembler/2002-04-04-PureVirtMethCall2.ll
* The change to fix these bugs was the to ValTypeBase::refineAbstractType
method. Basically we #if 0'd out the chunk of code there and make the
table get reorganized EVEN IF the type has the same pointer. Merging
opportunities were being missed!
llvm-svn: 2121
2002-04-05 22:25:26 +00:00
Chris Lattner
3b80438423
Clean up debugging code
...
llvm-svn: 2119
2002-04-05 19:53:06 +00:00
Chris Lattner
e105f97672
* Refactor loop in removeAbstractTypeUser to be more clear
...
* Fix a bug in DerivedType::refineAbstractTypeTo that caused
test/Regression/Assembler/2002-04-05-TypeParsing.ll to fail.
The added comment describes the fix
llvm-svn: 2118
2002-04-05 19:44:07 +00:00
Chris Lattner
8afff0c29a
s/MethodType/FunctionType
...
llvm-svn: 2115
2002-04-04 22:19:18 +00:00
Chris Lattner
39d7d981ed
Make build work in release mode
...
llvm-svn: 2113
2002-04-04 19:35:24 +00:00
Chris Lattner
ffc9ef8be9
Make the release build work
...
llvm-svn: 2109
2002-04-04 19:26:26 +00:00
Chris Lattner
87cabdd757
* Add debug support for PATypeHolder
...
* PATypeHolder is now not a template
llvm-svn: 2108
2002-04-04 19:26:02 +00:00
Chris Lattner
a0a6c8d4a2
Make the release build compile
...
llvm-svn: 2107
2002-04-04 19:24:48 +00:00
Chris Lattner
1ee6bf5249
PATypeHolder is now not a template
...
llvm-svn: 2106
2002-04-04 19:24:34 +00:00
Chris Lattner
798be9a43a
Add debug support
...
llvm-svn: 2105
2002-04-04 19:24:11 +00:00
Chris Lattner
78b786813b
* Make PATypeHolder not take a type argument
...
* Eliminate by inlining the old newTH, newTH, and TypeDone functions
* OPAQUE is now just a token that gets returned by the lexer, not a type
Parser now creates type, not lexer
llvm-svn: 2104
2002-04-04 19:23:55 +00:00
Chris Lattner
feeac9c7ea
Lexer doesn't create typehandle gross stuff now, parser does.
...
llvm-svn: 2103
2002-04-04 19:22:17 +00:00
Chris Lattner
5cbfde5744
Call nodes are never equivalent
...
Shadow nodes are never critical.
llvm-svn: 2102
2002-04-04 19:21:51 +00:00
Chris Lattner
d4c7ce8d78
Add hack to get timing of analysis
...
llvm-svn: 2101
2002-04-04 19:21:27 +00:00
Chris Lattner
3b604e846a
* Eliminate commented out code
...
* Do not demand a shadow node when resolving
* Raise arbitrary inline limit
llvm-svn: 2100
2002-04-04 19:21:06 +00:00
Chris Lattner
19689af3bb
Support resolving function arguments/return values to pointers that index
...
into other objects.
llvm-svn: 2094
2002-04-01 22:20:48 +00:00
Vikram S. Adve
0035fcbea1
Case numbers were not updated when Sparc.burg.in was changed
...
to add separate label for bitwise NOT operator.
llvm-svn: 2091
2002-04-01 20:28:48 +00:00
Chris Lattner
0f0829f28d
Add a new replaceWith method useful for replacing instructions
...
llvm-svn: 2088
2002-04-01 17:52:16 +00:00
Chris Lattner
2e3a4dece6
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
99da111daf
Add extra case here to avoid getting spurious output
...
llvm-svn: 2086
2002-04-01 00:45:33 +00:00
Chris Lattner
62756e4208
Avoid incorrectly adding null values to the scalar map!
...
llvm-svn: 2085
2002-04-01 00:45:09 +00:00
Chris Lattner
e66e651b68
Critical shadow nodes no do not know their parent explictly.
...
llvm-svn: 2084
2002-04-01 00:15:30 +00:00
Chris Lattner
61f6065cef
Minor cleanups (use dyn_cast instead of testing manually)
...
Shadow nodes now don't explicitly know their parent.
llvm-svn: 2083
2002-04-01 00:14:41 +00:00
Chris Lattner
a68c92a3d4
Allow merging of identical call nodes. Make the shadow node pointed to
...
by the call node noncritical before the call is destroyed.
llvm-svn: 2082
2002-04-01 00:13:56 +00:00
Chris Lattner
f9097b54be
Increase limit for perimeter
...
llvm-svn: 2081
2002-04-01 00:12:58 +00:00
Chris Lattner
42145d8a25
Unify the destruction code used for node pairs vs normal nodes. This was
...
causing a problem before because global values with incoming edges didn't
copy the incoming edges to the node they were being merged from, causing
the poolalloc pass to die.
llvm-svn: 2079
2002-03-31 19:57:44 +00:00
Vikram S. Adve
e665a992a9
1. Fix a leftover bug in generating memory instructions.
...
2. Fix type used for TmpInstruction holding the return address.
llvm-svn: 2075
2002-03-31 19:07:35 +00:00
Vikram S. Adve
257e4d18da
Added function getCallInstIndirectAddrVal() to set call interference
...
for that value.
llvm-svn: 2074
2002-03-31 19:04:50 +00:00
Vikram S. Adve
8efa40ac63
Minor cleanup in printing constants. I think this included a bug
...
fix related to putting a read-write variable in a read-only section,
but I'm not sure now.
llvm-svn: 2073
2002-03-31 19:03:58 +00:00
Vikram S. Adve
44ee4184e4
Add method clearCallInterference().
...
llvm-svn: 2071
2002-03-31 18:58:14 +00:00
Vikram S. Adve
c2c33ba3fd
Include temp. values when computing max. size of stack frame!
...
llvm-svn: 2070
2002-03-31 18:57:49 +00:00
Vikram S. Adve
1e6ab6f476
Fix a bug in previous bug fix.
...
llvm-svn: 2069
2002-03-31 18:56:51 +00:00
Vikram S. Adve
fbdd533059
Bug fix: address used by indirect call instruction should also
...
be marked as having a Call Interference, even though it may not
be live after the call.
llvm-svn: 2068
2002-03-31 18:54:37 +00:00
Chris Lattner
c620b825b6
Add debug output
...
llvm-svn: 2066
2002-03-31 07:17:46 +00:00
Chris Lattner
164b766137
* Fix nondeleted type handle which could cause type pool corruption (and
...
a memory leak)
* Fix memory leak of Argument nodes on function prototypes
llvm-svn: 2065
2002-03-31 07:16:49 +00:00
Chris Lattner
8528806b33
* Move the isEquivalentTo implementations here. They can probably be put
...
someplace nicer in the file though.
* Add new dump method for debugging
llvm-svn: 2064
2002-03-31 07:16:08 +00:00
Chris Lattner
d2c39a02f7
Print out the instruction instead of just the address!
...
llvm-svn: 2063
2002-03-31 07:15:20 +00:00
Chris Lattner
aba1ef6fc9
* Move isEquivalentTo implementations to NodeImpl
...
* Implement a new form of node folding to catch cases missed in Addtree
* Add removeIndistinguishableNodePairs to merge calls (todo) and globals
llvm-svn: 2062
2002-03-31 07:14:52 +00:00
Chris Lattner
f1a2a9c168
* Convert CallMap to be a vector, because the keys can change, and the map
...
doesn't resort!
* Be more generous with the cached matches that we allow now.
* Recursive calls should all work now!
llvm-svn: 2061
2002-03-31 07:13:27 +00:00
Vikram S. Adve
f057ff78fb
Fix CreateUIntSetInstruction() to handle sign extensions correctly.
...
llvm-svn: 2059
2002-03-31 00:13:12 +00:00
Chris Lattner
4c4a273f43
* 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
410c6394d3
* 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
36d50d01ab
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
a4b9a9f573
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
c7df07c3f8
* s/Method/Function
...
* Implement a check to make sure a function is not internal and external
at the same time
llvm-svn: 2050
2002-03-29 19:06:18 +00:00
Chris Lattner
9166ac0b3f
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
b6b7c3fe60
s/Method/Function
...
llvm-svn: 2048
2002-03-29 19:04:45 +00:00
Chris Lattner
57dd5ed245
New clone function routine
...
llvm-svn: 2045
2002-03-29 19:03:54 +00:00
Chris Lattner
6b1ce137c2
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
5df9c977e1
s/Method/Function
...
llvm-svn: 2043
2002-03-29 17:08:29 +00:00
Chris Lattner
3a9f1dd66a
Modularize code a bit
...
llvm-svn: 2040
2002-03-29 06:21:38 +00:00
Chris Lattner
7c2529076a
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
18cc6a9277
Add an insert method to VAlueHolder to allow batch insertion
...
llvm-svn: 2038
2002-03-29 05:49:37 +00:00
Chris Lattner
474495e742
Add new addTypeName method to Module class
...
llvm-svn: 2037
2002-03-29 04:48:40 +00:00
Chris Lattner
dc0566e721
s/Method/Function
...
llvm-svn: 2036
2002-03-29 03:57:15 +00:00
Chris Lattner
8c98acc07f
s/Method/Function
...
llvm-svn: 2035
2002-03-29 03:51:11 +00:00
Chris Lattner
084601e6f4
s/Method/Function
...
llvm-svn: 2034
2002-03-29 03:44:36 +00:00
Chris Lattner
c32e9901b1
Implement new getFunction and getOrInsertFunction methods
...
llvm-svn: 2033
2002-03-29 03:44:18 +00:00
Chris Lattner
a2d3c99dfc
Simplify code a bit by using Module::getOrInsertFunction
...
llvm-svn: 2032
2002-03-29 03:43:24 +00:00
Chris Lattner
815e2f4daa
Flesh out a bunch more code, print allocations that are poolable.
...
llvm-svn: 2031
2002-03-29 03:40:59 +00:00
Chris Lattner
e46e35806a
s/method/function
...
llvm-svn: 2030
2002-03-29 03:40:25 +00:00
Chris Lattner
4ca6fd00f2
s/Method/Function/g
...
llvm-svn: 2029
2002-03-29 03:39:36 +00:00
Chris Lattner
b7f4043df7
Simplify code a lot by using the Module::getFunction & getOrInsertFunction
...
llvm-svn: 2028
2002-03-29 03:38:05 +00:00
Chris Lattner
ab9cc61ceb
Remove the reduceApply functions they are obsolete things from the days before
...
we had a reasonable pass system
llvm-svn: 2022
2002-03-28 22:49:49 +00:00
Chris Lattner
cab0ce8244
Implement getEscapingAllocations & getNonEscapingAllocations
...
llvm-svn: 2021
2002-03-28 19:33:00 +00:00
Chris Lattner
513ecd7256
* Rename UnlinkUndistinguishableShadowNodes & RemoveUnreachableShadowNodes
...
to reflect that they can eliminate arbitrary nodes.
* Rename the ShadowNodeEliminate.cpp file to EliminateNodes.cpp for the
same reason
llvm-svn: 2020
2002-03-28 19:16:48 +00:00
Chris Lattner
fa67ad938c
Ooops, I did such a great job pruning nodes, that I accidentally deleted
...
ALL allocation nodes... hrm... bad.
llvm-svn: 2018
2002-03-28 18:38:38 +00:00
Chris Lattner
0336a78488
Initial checkin of Noop pass that will be the pool allocator
...
llvm-svn: 2014
2002-03-28 18:08:31 +00:00
Chris Lattner
55186e7abf
Many changes
...
* Simplify a lot of the inlining stuff. There are still problems, but not
many
* Break up the Function representation to have a vector for every different
node type so it is fast to find nodes of a particular flavor.
* Do more intelligent merging of call values
* Allow elimination of unreachable shadow and allocation nodes
* Generalize indistinguishability testing to allow merging of identical calls.
* Increase shadow node merging power
llvm-svn: 2010
2002-03-28 17:56:03 +00:00
Cameron Buschardt
49c09d5b24
* Move classes around
...
* rename constructor function
* Move stuff into anonymous namespaces
llvm-svn: 2007
2002-03-27 23:28:40 +00:00
Cameron Buschardt
bcff69b0f4
Implemented promote mem->reg pass.
...
llvm-svn: 2005
2002-03-27 23:17:37 +00:00
Chris Lattner
d771725ed1
* Add #define to enabled debug messages
...
* Move removeEdgesTo to be a member of DSNode
* Implement (but #ifdef out) the new, spiffier, method of determining
shadow node equivalence. This cannot be enabled until more is
implemented.
llvm-svn: 2004
2002-03-27 19:48:03 +00:00
Chris Lattner
4c6e9cda3f
* Implement DSNode::removeAllIncomingEdges
...
* Implement Critical Shadow node handling
* Implement routines to determine whether an allocation node is a malloc
or alloca
llvm-svn: 2003
2002-03-27 19:46:05 +00:00
Chris Lattner
a16c85b43d
* Add critical node support
...
* Optimize graph after building it. This should be unneccesary in the future
llvm-svn: 2002
2002-03-27 19:45:12 +00:00
Chris Lattner
9aff5a8047
* Destroy alloca nodes when a graph gets inlined
...
* Add links to all subtrees when a shadow node gets resolved
* Add critical node handling
llvm-svn: 2001
2002-03-27 19:44:33 +00:00
Chris Lattner
2a3d6c83ff
* Optimizers return true on change
...
* Implement indistinguishable shadow node elimination
llvm-svn: 1999
2002-03-27 00:55:13 +00:00
Chris Lattner
ae0192e2f6
Fix long line
...
llvm-svn: 1998
2002-03-27 00:54:31 +00:00
Chris Lattner
8a44f81684
* Because of optimization, the shadow nodes between arguments might get
...
removed. Check to see if they are there.
* Repeat optimizations while changing
llvm-svn: 1997
2002-03-27 00:53:57 +00:00
Chris Lattner
d5b115e687
Initial checkin of Datastructure analysis.
...
Has bugs, but shouldn't crash in theory.
llvm-svn: 1994
2002-03-26 22:39:06 +00:00
Chris Lattner
18073550b8
Change from Method to Function
...
llvm-svn: 1992
2002-03-26 18:02:30 +00:00
Chris Lattner
849c762b02
Change references from Method to Function
...
change references from MethodARgument to FunctionArgument
llvm-svn: 1991
2002-03-26 18:01:55 +00:00
Chris Lattner
8972179a78
Convert to use new style casts instead of direct checking
...
llvm-svn: 1990
2002-03-26 17:58:12 +00:00
Chris Lattner
57efd6ffd1
change refs to Method to Function
...
Change references to MEthodArgument to FunctionArgument
llvm-svn: 1989
2002-03-26 17:55:33 +00:00
Vikram S. Adve
bd1e4e8bd8
Moved to directory Scalar/ and renamed.
...
llvm-svn: 1977
2002-03-24 03:55:06 +00:00
Vikram S. Adve
3dfd5b888b
Destroy MethodLiveVarInfo after register allocation.
...
llvm-svn: 1976
2002-03-24 03:54:03 +00:00
Vikram S. Adve
fa2ed7e6b1
Use deterministic iterator for SchedGraphs. This is actually not
...
useful right now when we only do local scheduling.
llvm-svn: 1975
2002-03-24 03:53:03 +00:00
Vikram S. Adve
058ec11ea3
Bug fix: nextToTry was not being initialized in one case.
...
llvm-svn: 1974
2002-03-24 03:46:15 +00:00
Vikram S. Adve
37d44e7de9
Add option to disable scheduling.
...
llvm-svn: 1973
2002-03-24 03:45:35 +00:00
Vikram S. Adve
0cdcf40121
Add option to disable scheduling.
...
Destroy live-variable information after scheduling so it is
recomputed before later phases (e.g., reg. allocation).
Use deterministic iterator to enumerate sched graphs.
llvm-svn: 1972
2002-03-24 03:44:55 +00:00
Vikram S. Adve
d18a1cc9fb
Minor changes.
...
llvm-svn: 1971
2002-03-24 03:40:59 +00:00
Vikram S. Adve
e06cac463f
Re-fix bug: Put back MachineCodeForInstruction::dropAllReferences.
...
llvm-svn: 1970
2002-03-24 03:40:11 +00:00
Vikram S. Adve
b347d2796c
Fix padding for variables allocated on stack.
...
llvm-svn: 1969
2002-03-24 03:39:26 +00:00
Vikram S. Adve
34306e0e1c
Major overhaul to FoldGetElemPtr to handle mixed array and struct refs.
...
llvm-svn: 1968
2002-03-24 03:37:53 +00:00
Vikram S. Adve
8493ae74b2
Use deterministic iterator for treeRoots.
...
llvm-svn: 1967
2002-03-24 03:36:52 +00:00
Vikram S. Adve
8ada4c031e
Bug re-fix: put back MachineCodeForInstruction::get(*I).dropAllReferences().
...
Also re-enable instr. scheduling pass.
llvm-svn: 1966
2002-03-24 03:35:16 +00:00
Vikram S. Adve
7b84ec22d8
Change latencies for Load, Store and Branch instructions.
...
llvm-svn: 1965
2002-03-24 03:33:53 +00:00
Vikram S. Adve
57d735db7a
Major enhancements to how array and structure indices are handled.
...
Improve checking for constants in Multiply.
Simpler method to keep track of when a node is folded into its parent.
Several other bug fixes.
llvm-svn: 1964
2002-03-24 03:33:02 +00:00
Vikram S. Adve
a141a7190b
Change treeRoots data structure to make enumeration deterministic.
...
llvm-svn: 1962
2002-03-24 03:24:00 +00:00
Vikram S. Adve
1f5e8f93cc
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
c481e92886
Rename Method to Function
...
llvm-svn: 1957
2002-03-23 22:51:58 +00:00
Vikram S. Adve
3294262573
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
0b9734b293
Add an assertion that would hopefully catch a problem that was tripping
...
cameron up
llvm-svn: 1944
2002-03-22 18:01:58 +00:00
Chris Lattner
2ed4beefea
Fix bug test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise3.ll
...
llvm-svn: 1943
2002-03-21 23:02:37 +00:00
Chris Lattner
ad241cc3ea
Fix test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise2.ll
...
llvm-svn: 1941
2002-03-21 22:39:59 +00:00
Chris Lattner
8051e7c953
* AllocationInst ctor moved here from iMemory.h
...
* AllocationInst now always has an array size operand
llvm-svn: 1939
2002-03-21 22:37:48 +00:00
Chris Lattner
a80b65c208
Fix test/Regression/Other/2002-03-21-LevelRaiseMiss.ll
...
llvm-svn: 1933
2002-03-21 21:21:13 +00:00
Chris Lattner
c2b5cb5619
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
559c71f6f4
Implement the new InsertInstBeforeInst function
...
llvm-svn: 1930
2002-03-21 06:24:00 +00:00
Chris Lattner
14fe793707
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
e9ec6058e4
Declare the new InsertInstBeforeInst function
...
llvm-svn: 1927
2002-03-21 06:15:53 +00:00
Chris Lattner
ceb4e429a2
Add an assertion to catch a misuse of replaceAllUsesWith
...
llvm-svn: 1924
2002-03-21 05:38:15 +00:00
Chris Lattner
72367834b0
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
db90f5f6ea
Namespace qualify debugging code
...
llvm-svn: 1921
2002-03-21 03:02:07 +00:00
Vikram S. Adve
92fb8b1f9c
Fixed several problems with handling arguments to Phis.
...
llvm-svn: 1910
2002-03-18 03:47:26 +00:00
Vikram S. Adve
cd6cb1962f
Big bug fix: killed uses were being inserted instead of erased!
...
Also added a set of debug options.
llvm-svn: 1909
2002-03-18 03:45:41 +00:00
Vikram S. Adve
308f672ac8
Just a comment.
...
llvm-svn: 1908
2002-03-18 03:40:25 +00:00