1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 22:42:52 +01:00
Commit Graph

1341 Commits

Author SHA1 Message Date
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
Vikram S. Adve
5f910def00 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
Vikram S. Adve
8553fc5d21 Big bug fix: getUsableUniRegAtMI needed to return values in arguments
but did not pass the arguments by reference!

llvm-svn: 1906
2002-03-18 03:37:19 +00:00
Vikram S. Adve
855ed3d941 Added function computeOffsetforLocalVar to check how big the
offset-from-FP will be before allocating space for a local variable.

llvm-svn: 1905
2002-03-18 03:36:30 +00:00
Vikram S. Adve
edc1adae11 Bug fix in setting CC register.
Also use distinct names for the three types of SetMachineOperand
to avoid painful overloading problems and errors.

llvm-svn: 1904
2002-03-18 03:35:24 +00:00
Vikram S. Adve
b26ed73c33 Constants are now added to the constant pool only when a load
instruction is actually generated for them.
Rename the different versions of SetMachineOperand.

llvm-svn: 1903
2002-03-18 03:33:43 +00:00
Vikram S. Adve
3fe5a9e913 Use vector for machine instructions returned by GetInstructionsByRule.
Fix constants in instructions generated for Phi elimination.

llvm-svn: 1902
2002-03-18 03:31:54 +00:00
Vikram S. Adve
125cd33f99 Big bug fix: getUsableUniRegAtMI needed to return values in arguments
but did not pass the arguments by reference!
Also added a function to get a register class by ID.

llvm-svn: 1901
2002-03-18 03:26:48 +00:00
Vikram S. Adve
7f139ccf85 Add support for code generation for array references.
Also, use distinct names for the three types of SetMachineOperand to
avoid painful overloading problems and errors.
Bug fix in converting-int-to-float.  Other minor stuff.

llvm-svn: 1896
2002-03-18 03:15:35 +00:00
Vikram S. Adve
217f7b1fe1 Bug fixes for not using unified reg. numbers, and for using the
wrong register class for saving CC registers.
Also, use distinct names for the three types of SetMachineOperand.

llvm-svn: 1895
2002-03-18 03:12:16 +00:00
Vikram S. Adve
6a74ad7030 Use distinct names for the three types of SetMachineOperand to
avoid painful overloading problems and errors.

llvm-svn: 1893
2002-03-18 03:09:15 +00:00
Vikram S. Adve
f7d5ad2124 Minor fixes.
llvm-svn: 1892
2002-03-18 03:08:07 +00:00
Vikram S. Adve
23d4011ea1 Handling of global names was severely broken when converting to 2 passes.
Different labels were generated for the same name in different passes.
Use an annotation to hold a fixed table of names.

llvm-svn: 1891
2002-03-18 03:07:26 +00:00
Vikram S. Adve
d311d0d546 Several sundry bug fixes.
llvm-svn: 1890
2002-03-18 03:02:42 +00:00
Chris Lattner
240209eb5b Make an assertion provide a more helpful error message
llvm-svn: 1883
2002-03-17 21:16:01 +00:00
Chris Lattner
88ccdcd73e 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
ba358e8e65 Checkin new test for problem anand ran into
llvm-svn: 1880
2002-03-15 20:25:09 +00:00
Chris Lattner
55aff5c433 Cleanup error message output a bit
llvm-svn: 1879
2002-03-15 20:21:29 +00:00
Chris Lattner
8cc6186707 Fix test/Regression/Other/2002-03-14-ValueToLarge.ll. Note that this
fix could be better, but we don't have the infrastructure to find out what
size types are yet.

llvm-svn: 1876
2002-03-14 22:35:50 +00:00
Chris Lattner
1a4aac1060 Add a check to ensure that only PHI nodes are self referential. Code
input to instruction combination was broken, which caused it to explode.

llvm-svn: 1870
2002-03-14 16:53:48 +00:00
Chris Lattner
2ecc9a337c Fix bug: test/Regression/Other/2002-03-14-LevelRaiseHang.ll
llvm-svn: 1869
2002-03-14 16:37:04 +00:00
Chris Lattner
b0128957b1 Fix bug: test/Regression/Other/2002-03-11-InstCombineHang.ll
llvm-svn: 1864
2002-03-11 23:28:45 +00:00
Chris Lattner
ba4660ff3d update comments
llvm-svn: 1862
2002-03-11 22:21:04 +00:00
Chris Lattner
0f8d0257f9 * 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
23379a852e Implement TODO for better diagnostic output
llvm-svn: 1859
2002-03-11 22:12:39 +00:00
Chris Lattner
889b1e5b00 Fix bug: test/Regression/Other/2002-03-11-ConstPropCrash.ll
llvm-svn: 1858
2002-03-11 22:11:07 +00:00
Chris Lattner
35c1c7353b Bugfix for test/Regression/Other/2002-03-11-ExprAssertion.ll
llvm-svn: 1856
2002-03-11 20:50:24 +00:00
Chris Lattner
558efd4bf0 Remove runtime library in favor of users linking against real libraries.
llvm-svn: 1853
2002-03-11 17:57:13 +00:00
Chris Lattner
32669e6211 Do not link in runtime library anymore, assume that user manually links in
libraries.  Code should be generalized to allow lli to take -lc -lm arguments
in the future (todo)

llvm-svn: 1852
2002-03-11 17:52:43 +00:00
Chris Lattner
34eab0d19c Fix bug: test/Regression/Other/2002-03-11-LevelRaiseCalls.ll
llvm-svn: 1844
2002-03-11 17:27:34 +00:00
Chris Lattner
e71c9ba6d0 Implement a bunch of new functions to support the SPECINT mcf
benchmark

llvm-svn: 1841
2002-03-08 22:51:07 +00:00
Chris Lattner
b44f81b987 * Add new method localLookup
* SymbolTable::remove(Value *N) checks to see if we are internally
  inconsistent before looking for a type plane (caused a crash)
* insertEntry now does a local lookup instead of a global lookup, which was
  causing an infinite loop in the renamer logic.
* Added assertions to make sure stuff stays happy
* Now the linker correctly links the SPECINT2000 mcf benchmark

llvm-svn: 1840
2002-03-08 20:26:17 +00:00
Chris Lattner
d9558891af Fix bug: test/Regression/2002-03-08-NameCollision2.ll
llvm-svn: 1839
2002-03-08 19:11:42 +00:00
Chris Lattner
c49eff8d4b Fix minor memory leak
llvm-svn: 1837
2002-03-08 18:57:56 +00:00
Chris Lattner
49c5f320ff Fix for: test/Regression/Assembler/2002-03-08-NameCollision.ll
llvm-svn: 1836
2002-03-08 18:41:32 +00:00
Chris Lattner
60cb774b66 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
09424811e9 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
0c7a32d2f4 Initial checkin
llvm-svn: 1831
2002-03-07 20:16:38 +00:00
Chris Lattner
0f0ed63279 Clean up call graph, add comments, and fix test/Regression/Other/2002-01-31-CallGraph.ll
llvm-svn: 1828
2002-03-06 20:19:35 +00:00
Chris Lattner
cc1fa55c61 Pull interprocedural analyses out of Analysis library into their own lib
llvm-svn: 1827
2002-03-06 18:44:29 +00:00
Chris Lattner
ed067d6d91 Move call graph printing support out of Writer.h into Callgraph.h
remove dead global function

llvm-svn: 1825
2002-03-06 18:00:49 +00:00
Chris Lattner
962e012ad5 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
Vikram S. Adve
17ec828187 Fix include error.
llvm-svn: 1819
2002-03-03 20:46:32 +00:00
Chris Lattner
e2383e8592 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
00ef917e01 Expose more entry points to the verifier
llvm-svn: 1815
2002-02-26 21:45:33 +00:00
Chris Lattner
1b9b843452 Move ProfilePaths class into ProfilePaths library, only expose a creation function
llvm-svn: 1812
2002-02-26 20:04:59 +00:00
Chris Lattner
6693158d06 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
6145c5df9d 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
12573def64 * 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
3644255181 Makefile for profile-paths
llvm-svn: 1807
2002-02-26 19:36:43 +00:00
Anand Shukla
b9e67e748a Initial checkin: functions on Graph used for path profile pass
llvm-svn: 1806
2002-02-26 19:02:16 +00:00
Anand Shukla
d3ce435557 Initial checkin: instrument code to get path execution frequency
llvm-svn: 1805
2002-02-26 19:00:48 +00:00
Anand Shukla
d5d415f609 Initial checkin: helper file to insert instrumentation code along edges
llvm-svn: 1804
2002-02-26 18:59:46 +00:00
Anand Shukla
4f842414ae 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
32c3ca3f0c Change to make it build with GCC 2.95.3
llvm-svn: 1802
2002-02-26 18:57:15 +00:00
Anand Shukla
d7f2b91c9b New makefile to include ProfilePaths dir
llvm-svn: 1799
2002-02-26 18:20:27 +00:00
Chris Lattner
3b0be84157 Fix bug: test/Regression/Other/2002-02-24-InlineBrokePHINodes.ll
llvm-svn: 1798
2002-02-25 00:35:07 +00:00
Chris Lattner
11d689e99a When inlining basic blocks and instructions, give them a name!
llvm-svn: 1796
2002-02-25 00:31:02 +00:00
Chris Lattner
44d96e69f4 Remove hack. This is better fixed in Makefile.common
llvm-svn: 1795
2002-02-24 23:25:46 +00:00
Chris Lattner
dcdf0532ff Build with newer compiler, with same bug
llvm-svn: 1793
2002-02-24 23:11:05 +00:00
Chris Lattner
b4e6953fc0 Namespaces
llvm-svn: 1791
2002-02-24 23:03:09 +00:00
Chris Lattner
242f5139fb Clean up std namespace issues
Silence warning

llvm-svn: 1790
2002-02-24 23:02:40 +00:00
Chris Lattner
08443aa73b 64 bit clean now
llvm-svn: 1789
2002-02-24 23:02:12 +00:00
Chris Lattner
c1de0d6e83 * Make it compile with GCC 3.0.4
llvm-svn: 1788
2002-02-24 23:01:56 +00:00
Chris Lattner
3cffcc10bc * Silence signed/unsigned warnings
* Make it compile with GCC 3.0.4

llvm-svn: 1787
2002-02-24 23:01:50 +00:00
Chris Lattner
b10862d793 Make it compile with GCC 3.0.4
llvm-svn: 1786
2002-02-24 23:01:21 +00:00
Chris Lattner
ec7118a6aa Close input file if exception is thrown
llvm-svn: 1784
2002-02-20 18:06:43 +00:00
Chris Lattner
1b91bcee90 Change to verifier interface
llvm-svn: 1782
2002-02-20 17:56:02 +00:00
Chris Lattner
75c1ff0221 Actually implement some checking in the verifier.
These specific problems were ones Anand ran into in his work and seem not
uncommon for beginners.

llvm-svn: 1781
2002-02-20 17:55:43 +00:00
Chris Lattner
aa07d741cb Fix isArrayAllocation() to be correct
llvm-svn: 1779
2002-02-19 21:24:17 +00:00
Chris Lattner
f576e43330 Keep track of memory allocated by alloca so that it is freed appropriately
llvm-svn: 1776
2002-02-19 18:50:09 +00:00
Chris Lattner
801f59eb1f Implement exp function
llvm-svn: 1774
2002-02-18 19:06:25 +00:00
Chris Lattner
3d83ea4268 Handle more cases in the linker
llvm-svn: 1771
2002-02-18 19:05:15 +00:00
Chris Lattner
a87f4f1b13 Bug fix for test/Regression/Other/2002-02-14-LevelRaiseBadAssert.ll
llvm-svn: 1767
2002-02-14 22:21:40 +00:00
Chris Lattner
6ae007b43e 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
1ae58c1268 * 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
8e9be000a7 * 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
b0a2c5546b 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
5276164ac4 Add neccesary #include
llvm-svn: 1742
2002-02-12 20:19:06 +00:00
Chris Lattner
20edcad40a 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
326b548cd4 Initial checkin of new memory -> register promotion pass
llvm-svn: 1739
2002-02-12 17:16:22 +00:00
Chris Lattner
ce754be520 Add new abort-on-exceptions flag
llvm-svn: 1737
2002-02-12 15:47:23 +00:00
Chris Lattner
44572782a9 Write llvm bytecode to output .s file as last step of LLC.
llvm-svn: 1728
2002-02-11 22:35:46 +00:00
Chris Lattner
658f0b593d Make array bound checks optional and disabled by default.
llvm-svn: 1725
2002-02-11 20:19:16 +00:00
Chris Lattner
2f9f8dbc92 Fix build error
llvm-svn: 1722
2002-02-11 17:11:43 +00:00
Chris Lattner
3b3ee75819 Convert BBLiveVar to be a BasicBlock annotation, this removes the BB2BBLVMap from MethodLiveVarInfo.
llvm-svn: 1721
2002-02-05 06:52:25 +00:00
Chris Lattner
e282c0b592 Convert operand iterator over to work like an STL iterator
llvm-svn: 1720
2002-02-05 06:02:59 +00:00
Chris Lattner
5337fbec40 Minor change: Methods that return ValueSet's that are guaranteed to be valid
return references instead of pointers.

llvm-svn: 1719
2002-02-05 04:20:12 +00:00
Chris Lattner
862fab4da7 * Code Cleanups
* Removal dependencies on Type.h & remove uses of getTypeID()

llvm-svn: 1718
2002-02-05 03:52:29 +00:00
Chris Lattner
73812e2833 * Code Cleanups of IGNode.h
* Removal of getTypeID() methods, and dependence on llvm/Type.h, from IGNode & LiveRange

llvm-svn: 1717
2002-02-05 03:51:37 +00:00
Chris Lattner
164a9ea118 Must include SetOperations to do set_*
llvm-svn: 1716
2002-02-05 03:35:53 +00:00
Chris Lattner
c77877fb46 Remove generic routines to Support/SetOperations.h
llvm-svn: 1715
2002-02-05 03:35:31 +00:00
Chris Lattner
6c0cbc3009 Remove empty files
llvm-svn: 1713
2002-02-05 02:52:53 +00:00
Chris Lattner
f3d0ae9fdb * Eliminate the LiveVarSet class, making applyTranferFuncForMInst a static
function in the one .cpp file that uses it.  Use ValueSet's instead.
* Prepare to delete LiveVarSet.h & LiveVarSet.cpp
* Eliminate the ValueSet class, making all old member functions into global
  templates that will eventually be moved to Support.
* Eliminate some irrelevant const's

llvm-svn: 1712
2002-02-05 02:52:05 +00:00
Chris Lattner
dc3aec7a90 * Eliminate the LiveVarSet class, making applyTranferFuncForMInst a static
function in the one .cpp file that uses it.  Use ValueSet's instead.
* Prepare to delete LiveVarSet.h & LiveVarSet.cpp
* Eliminate the ValueSet class, making all old member functions into global
  templates that will eventually be moved to Support.

llvm-svn: 1711
2002-02-05 02:51:01 +00:00
Chris Lattner
a8170f0944 * Code Cleanups
* Introduce RAV to allow stream I/O instead of using printValue

llvm-svn: 1710
2002-02-05 01:43:49 +00:00
Chris Lattner
2f8b10ceef Changes neccesary due to the move of BBLiveVar.h to the lib/Analysis/LiveVar directory
llvm-svn: 1709
2002-02-05 00:43:37 +00:00
Chris Lattner
467da46166 * Add a #include not indirectly included any more
llvm-svn: 1707
2002-02-05 00:35:14 +00:00
Chris Lattner
9684272bd9 * Give BBLiveVar.cpp a proper file header
* applyFlowFunc DOES NOT NEED TO COPY the huge BB->BBLiveVar Map every time it is invoked!
* Big cleanups.
* Make BBLiveVar.h effectively an internal header file
* Prepare LiveVarMap.h for deletion

llvm-svn: 1706
2002-02-05 00:34:50 +00:00
Chris Lattner
1181768743 * Big cleanups.
* Make BBLiveVar.h effectively an internal header file
* Prepare LiveVarMap.h for deletion

llvm-svn: 1705
2002-02-05 00:33:19 +00:00
Chris Lattner
79a488ee14 Code cleanups, no functional change
llvm-svn: 1704
2002-02-04 23:31:16 +00:00
Chris Lattner
62860d4c3d Clean up MethodLiveVarInfo
llvm-svn: 1703
2002-02-04 20:49:04 +00:00
Chris Lattner
a576f85e4b The interface to instruction scheduling is now just a call to get the pass.
llvm-svn: 1702
2002-02-04 20:03:43 +00:00
Chris Lattner
817f1768d4 * RegisterAllocation _uses_ LiveVar analysis, instead of creating it's own copy
llvm-svn: 1701
2002-02-04 20:02:38 +00:00
Chris Lattner
9cd29563f0 * The itf exposed by InstrScheduling is now a single function to create the right pass
* InstructionScheduling is now a real pass
* InstrSched _uses_ LiveVar analysis, instead of creating it's own copy many times
  through a loop.  In this was LiveVarAnalysis is actually even SHARED by Register
  allocation.
* SchedPriorities is now passed the live var information in

llvm-svn: 1700
2002-02-04 20:02:16 +00:00
Chris Lattner
b4e0d0424c Turn live variable analysis into a real MethodPass.
llvm-svn: 1699
2002-02-04 20:00:08 +00:00
Chris Lattner
8a76e0e37e Remove Obsolete LoopDepthCalculator. All users should use LoopInfo directly.
llvm-svn: 1697
2002-02-04 17:49:01 +00:00
Chris Lattner
e264071f46 Switch register allocator over to using LoopInfo directly instead of indirectly through LoopDepthCalculator
llvm-svn: 1696
2002-02-04 17:48:00 +00:00
Chris Lattner
bb19367753 Make LoopDeptCalculator be an internal artifact of how RegAlloc is implemented,
do not expose it.  Additionally, have it be auto generated by the pass framework
for us.

llvm-svn: 1695
2002-02-04 17:39:42 +00:00
Chris Lattner
473793df61 REmove huge hack used by register allocator
llvm-svn: 1694
2002-02-04 17:39:02 +00:00
Chris Lattner
c457462f99 Make #include "llvm/Analysis/LoopDepth.h" be an internal artifact of how register allocation is implemented.
llvm-svn: 1693
2002-02-04 17:38:48 +00:00
Chris Lattner
e9cece61b7 * ValueSet interface converted from add/remove to insert/erase
llvm-svn: 1690
2002-02-04 16:37:09 +00:00
Chris Lattner
f3f13580e9 * Add #includes removed from headers
* ValueSet interface converted from add/remove to insert/erase
* Minor cleanups

llvm-svn: 1689
2002-02-04 16:36:59 +00:00
Chris Lattner
69e3aba1e9 Remove dependence on BBLiveVar from InstrScheduling
Minor cleanups

llvm-svn: 1688
2002-02-04 16:35:45 +00:00
Chris Lattner
92a00e8e0c * Add #includes that were yanked out of header files
* Convert over to valueset interface that uses insert & erase insead of add and remove
* the -> operator really isn't that hard to use!

llvm-svn: 1687
2002-02-04 16:35:12 +00:00
Chris Lattner
ce9503fd2e Cut down include pollution and number of frivolous consts.
llvm-svn: 1683
2002-02-04 16:31:03 +00:00
Chris Lattner
8bfb48c8d3 Convert RegisterAllocator interface to opaque pass type, so that users do not
need to know _anything_ about RegAlloc to use it.  Well in the end maybe.

llvm-svn: 1681
2002-02-04 15:54:09 +00:00
Chris Lattner
cc9876c869 EmitAssembly doesn't need an UltraSparc, it can do with any TargetMachine
llvm-svn: 1680
2002-02-04 15:53:23 +00:00
Chris Lattner
4f37a90fda Eliminate ModuleAnalyzer. It's old code that is not going to be used in the near future
llvm-svn: 1679
2002-02-04 06:47:17 +00:00
Chris Lattner
4c0bf66bdd * Minor cleanups
* Reduce number of #includes
* Remove blatently misleading qualifiers (how do you have an inlined pure virtual function?)
* Remove unnecesary & ignored qualifiers (const int argument vs int argument)
* SparcInternals.h now no longer #includes RegClass.h or SparcRegClassInfo.h
* Pull inlined functions out of .h file if they are virtual and interfere with dependencies

llvm-svn: 1677
2002-02-04 05:59:25 +00:00
Chris Lattner
cfc28e1cce Add code that used to be inline in MachineSchedInfo.h
llvm-svn: 1676
2002-02-04 05:56:30 +00:00
Chris Lattner
0de4b16eef Add #includes neccesary since they were removed from .h files
llvm-svn: 1675
2002-02-04 05:56:09 +00:00
Chris Lattner
f0828cf3dd Move instrIsFeasible from InstrScheduling.h
llvm-svn: 1674
2002-02-04 05:55:42 +00:00
Chris Lattner
009faad8e4 * Minor cleanups
* Reduce number of #includes, sometimes drastically (LiveRangeInfo.h lost _7_)
* Move instrIsFeasible() from InstrScheduling.h to SchedPriorities.h
* Delete blank lines at end of files

llvm-svn: 1672
2002-02-04 05:52:08 +00:00
Chris Lattner
8c2f0a45a6 Minor cleanups
llvm-svn: 1671
2002-02-04 05:48:24 +00:00
Chris Lattner
8dcb5c3736 SparcRegInfo does NOT need anything about instruction scheduling.
llvm-svn: 1670
2002-02-04 02:44:38 +00:00
Chris Lattner
45cdd0fb0c * Move command line parsing debug stuff to InstrScheduling internal header file
SchedPriorities.h

llvm-svn: 1669
2002-02-04 02:44:20 +00:00
Chris Lattner
b3e9cea0cd Pull all of the scheduling related stuff out of Sparc.cpp into it's own file
llvm-svn: 1668
2002-02-04 00:39:14 +00:00
Chris Lattner
9a8ff2595a Split RegisterAllocation stuff OUT of Sparc.cpp into a well defined pass
that has a very minimal interface (like it should have).

llvm-svn: 1667
2002-02-04 00:33:08 +00:00
Chris Lattner
78017556fc Move a ton of tables out of SparcInternals.h and move them to Sparc.cpp.
Eventually they will probably get moved again, but at least now they aren't
having to be compiled by 7 different .cpp files...

llvm-svn: 1666
2002-02-04 00:04:35 +00:00
Chris Lattner
b940cea55f Convert sparc backend over to use pass based compilation structure.
Try to decouple stuff as much as possible.

llvm-svn: 1664
2002-02-03 23:42:19 +00:00
Chris Lattner
b4df1958a9 Convert sparc backend over to use pass based compilation structure.
Convert some stages into passes in preparation for more splitting up.
Try to decouple stuff as much as possible.

llvm-svn: 1663
2002-02-03 23:41:51 +00:00
Chris Lattner
a4ae518ba6 Convert assembly emission over to a two pass approach.
llvm-svn: 1662
2002-02-03 23:41:08 +00:00
Chris Lattner
e1289c8b71 Code pulled out of MAchineInstr.(h|cpp)
llvm-svn: 1660
2002-02-03 07:54:50 +00:00
Chris Lattner
b6c38e3b50 Switch from MachineCodeForVMInstr model that is built into the VMCore library to an annotation based MAchineCodeForInstruction model
Instruction.cpp now has 0 lines of code generation related code in it.

llvm-svn: 1658
2002-02-03 07:52:58 +00:00
Chris Lattner
1099347f1e Add a file level comment
Remove #includes

llvm-svn: 1657
2002-02-03 07:52:04 +00:00
Chris Lattner
f26ffbbabc Implement new method by method assembly output & memory releasing
llvm-svn: 1656
2002-02-03 07:51:17 +00:00
Chris Lattner
de742eb319 * Switch to new TmpInstruction model
* Switch to new MachineCodeForInstruction model

llvm-svn: 1655
2002-02-03 07:50:56 +00:00
Chris Lattner
fe52dade08 * Switch to new TmpInstruction model
llvm-svn: 1654
2002-02-03 07:49:49 +00:00
Chris Lattner
40d9e197ee * Swithc to new MachineCodeForInstruction model
* Implement memory freeing for instruction temporaries

llvm-svn: 1653
2002-02-03 07:49:15 +00:00
Chris Lattner
8c0451be47 * prune #includes
* Implement permethod output of machine code to assembly

llvm-svn: 1652
2002-02-03 07:48:06 +00:00
Chris Lattner
fa7bc523a1 Add #include that is no longer implicitly included
llvm-svn: 1651
2002-02-03 07:47:05 +00:00
Chris Lattner
4315c295f5 Lots of code cleanups, no functional changes
llvm-svn: 1650
2002-02-03 07:46:34 +00:00
Chris Lattner
b8b17dc6dc * Prune #includes
* Remove MachineCodeFor(Method|VMInstr) code to their own .cpp files

llvm-svn: 1649
2002-02-03 07:46:01 +00:00
Chris Lattner
92340322ab * Switch over to cleaner TmpInstruction model
llvm-svn: 1648
2002-02-03 07:39:06 +00:00
Chris Lattner
53b8194805 * Straighten out #includes
* Switch to MAchineCodeForInstruction model instead of MachineCodeForVMInstr

llvm-svn: 1647
2002-02-03 07:33:46 +00:00
Chris Lattner
4e43c744da * Swich to annotation model for MachineCodeForInstruction
llvm-svn: 1646
2002-02-03 07:31:41 +00:00
Chris Lattner
8ea2029cfa Remove extraneous #includes
llvm-svn: 1645
2002-02-03 07:30:08 +00:00
Chris Lattner
a58db0f194 * Straighten out #includes
* Switch from MachineCodeForVMInstr to MachineCodeForInstruction model

llvm-svn: 1644
2002-02-03 07:29:45 +00:00
Chris Lattner
b44b5b6f9a * Get machine instrs from Instructin's by using MachineCodeForInstruction::get
* Convert a few (*X). to X->

llvm-svn: 1643
2002-02-03 07:28:30 +00:00
Chris Lattner
8a70c31470 Lots of nonfunctional code cleanups
llvm-svn: 1642
2002-02-03 07:25:25 +00:00
Chris Lattner
76ac6e30bd Add a class forward decl
llvm-svn: 1637
2002-02-03 07:13:04 +00:00
Chris Lattner
43ed408912 General cleanup
llvm-svn: 1628
2002-02-01 04:53:48 +00:00
Chris Lattner
a10c21a9d0 Add more debug output
llvm-svn: 1627
2002-02-01 04:53:36 +00:00
Chris Lattner
71e41586ae * Make debugging output nicer
* Implement pass memory freeing after the pass is unused
* Expose PassManager typedef in Pass.h instead of PassManager.h

llvm-svn: 1617
2002-01-31 18:32:27 +00:00
Chris Lattner
11aaf58393 Provide the right AnalysisID for postdominators
llvm-svn: 1616
2002-01-31 18:29:24 +00:00
Chris Lattner
0d3eaa9575 Eliminate SimplifyCFG.h file, pull everything into the UnifyMethodExitNodes class
llvm-svn: 1613
2002-01-31 01:12:06 +00:00
Chris Lattner
dc15bb209d 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
8d690f189c Implement new pass framework
llvm-svn: 1606
2002-01-31 00:45:31 +00:00
Chris Lattner
2e463f5dbe Convert xforms over to new pass structure.
llvm-svn: 1605
2002-01-31 00:45:11 +00:00
Chris Lattner
d1f09685e3 If an invalid alternative is listed for an argument, print the valid options
llvm-svn: 1604
2002-01-31 00:42:56 +00:00
Chris Lattner
15c05486cc Convert analyses to new pass structure
llvm-svn: 1603
2002-01-31 00:42:27 +00:00
Chris Lattner
e14adc7d65 Implement loop depth calculation in terms of dominators instead of intervals
No problems with irreducibility now

llvm-svn: 1602
2002-01-31 00:42:06 +00:00
Chris Lattner
3d52646383 LoopDepth calculation is now in CFG namespace
llvm-svn: 1601
2002-01-31 00:41:13 +00:00
Chris Lattner
85b82a690e Fix bug where we didn't initialize and finalize basic block passes
llvm-svn: 1599
2002-01-31 00:40:44 +00:00
Chris Lattner
3c0dcb01d4 Checkin new pass framework. This one is more useful and automatically
creates analysis results for passes that need them.   MethodPass's never
have to worry about being invoked on external methods.

llvm-svn: 1594
2002-01-30 23:20:39 +00:00
Chris Lattner
2cab187296 Remove extraneous #includes
llvm-svn: 1588
2002-01-26 22:47:32 +00:00
Chris Lattner
0fea9f487b Remove opt namespace
llvm-svn: 1587
2002-01-26 22:47:07 +00:00
Chris Lattner
d18db4006d This checkin fixes the bug described in:
test/Regression/Assembler/2002-01-24-BadSymbolTableAssert.ll

llvm-svn: 1583
2002-01-25 03:56:34 +00:00
Chris Lattner
1af4d669b3 Check in fix for bug: test/Regression/Assembler/ValueRefineAbsType.ll
llvm-svn: 1582
2002-01-25 03:45:27 +00:00
Chris Lattner
e77bf6231e Implement the clock() function
llvm-svn: 1573
2002-01-23 21:38:07 +00:00
Chris Lattner
c293ab6ae2 * Expose new command line arg --debug-pass for gccas and llc debugging
* Remember to initialize MethodPassBatcher::BBPBatcher instance var in ctor
* Move PassManager::run() from header file

llvm-svn: 1556
2002-01-23 05:49:41 +00:00
Chris Lattner
71ee02c009 Implement new DeadInstElmination pass
remove old comment

llvm-svn: 1555
2002-01-23 05:48:24 +00:00
Chris Lattner
24eb24166b Make it build with 2.95.3
llvm-svn: 1554
2002-01-23 05:47:57 +00:00
Chris Lattner
1728479df5 Oops, misnamed function, didn't override correctly, drat.
llvm-svn: 1528
2002-01-22 03:30:25 +00:00
Chris Lattner
e12b9f9277 Don't insert a useless cast
llvm-svn: 1527
2002-01-22 03:30:06 +00:00
Chris Lattner
4cecd63a42 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
15d533a331 Ooops, forgot to implement void PassManager::add(BasicBlockPass *BBP)
llvm-svn: 1523
2002-01-22 00:17:48 +00:00
Chris Lattner
83056c99ec 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
250d937680 LowerAllocations is really a BasicBlock pass. Make it so.
llvm-svn: 1521
2002-01-21 23:34:02 +00:00
Chris Lattner
4454cdc5c0 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
071f08916e Chuck fixed the GCC problems so this hack is now unneccesary
llvm-svn: 1519
2002-01-21 23:17:07 +00:00
Chris Lattner
15f43a7af7 Elminate an unused variable
llvm-svn: 1518
2002-01-21 23:16:30 +00:00
Chris Lattner
10a9b7627d Eliminate opt library
llvm-svn: 1516
2002-01-21 23:13:46 +00:00
Chris Lattner
0431e5fad5 Remove dead variable
llvm-svn: 1515
2002-01-21 22:50:38 +00:00
Chris Lattner
d40b986b74 Remove dead variable.
llvm-svn: 1514
2002-01-21 22:44:57 +00:00
Chris Lattner
c00c670e5f Pull stuff out of opt namespace
llvm-svn: 1511
2002-01-21 21:44:38 +00:00
Chris Lattner
bbb4dcdcd1 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
ebd5417901 Implementation of the new spiffy pass system
llvm-svn: 1508
2002-01-21 07:37:31 +00:00
Chris Lattner
2521ae1011 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
d0e1f35161 Oops lost a parenthesis somehow :(
llvm-svn: 1504
2002-01-21 01:33:12 +00:00
Chris Lattner
3dc9a2a61f Changes to build successfully with GCC 3.02
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Ruchira Sasanka
80acf30a7f Fixed a bug in spill cost estimation
llvm-svn: 1500
2002-01-08 16:29:23 +00:00
Ruchira Sasanka
b6d7a004fa PhyRegAlloc.cpp: Added temp area resetting before every call
llvm-svn: 1499
2002-01-07 21:09:06 +00:00
Ruchira Sasanka
b45080c5ba Added more comments
llvm-svn: 1498
2002-01-07 21:03:42 +00:00
Ruchira Sasanka
66b5593b96 removed SizeOfStackOperand constant from the SparcRegInfo class - no longer used
by code.

llvm-svn: 1497
2002-01-07 20:33:44 +00:00
Ruchira Sasanka
1d566afc16 Added more comments
llvm-svn: 1496
2002-01-07 20:28:49 +00:00
Ruchira Sasanka
04da4f197f Added comments and correct logic for finding register sizes.
llvm-svn: 1494
2002-01-07 19:20:28 +00:00
Ruchira Sasanka
222c51efe9 Added destructors and comments.
Added correct spill candidate selection logic.

llvm-svn: 1493
2002-01-07 19:19:18 +00:00
Ruchira Sasanka
3d5efa3be1 Added comments, destructors where necessary.
llvm-svn: 1491
2002-01-07 19:16:26 +00:00
Vikram S. Adve
b61dccd269 Eliminate function getIndicesBROKEN().
llvm-svn: 1486
2001-12-15 00:37:12 +00:00
Vikram S. Adve
0607fbbf01 Eliminate all uses of memInst->getIndicesBROKEN().
llvm-svn: 1485
2001-12-15 00:36:32 +00:00
Vikram S. Adve
1d755bccee getIndexedOffset() shd take vector of Values, not of Constants!
llvm-svn: 1484
2001-12-15 00:35:48 +00:00
Vikram S. Adve
605a47ebe4 Remove int hack to allow unsigned numbers greater than 2^63 - 1...
llvm-svn: 1483
2001-12-15 00:33:36 +00:00
Chris Lattner
37ba4e2bb7 initial checkin
llvm-svn: 1480
2001-12-14 16:52:21 +00:00
Chris Lattner
59918ae040 * Support the new -q flag for automated tests
* Remove unsized array support
* Add pointer indexing support

llvm-svn: 1477
2001-12-14 16:49:29 +00:00
Chris Lattner
8e4844c07b * Assert that indices are valid for an indexing instruction.
* Add support for indexing into pointers
* Remove support for unsized arrays

llvm-svn: 1472
2001-12-14 16:43:26 +00:00
Chris Lattner
eb03e839bc Rename ConstPoolVals.cpp to Constants.cpp
llvm-svn: 1471
2001-12-14 16:42:30 +00:00
Chris Lattner
e443a8ff8d Remove unsized array support
Add new SequentialType class

llvm-svn: 1470
2001-12-14 16:41:56 +00:00
Chris Lattner
ba664bbc27 Make strings SByte* arrays instead of UByte * arrays
llvm-svn: 1469
2001-12-14 16:41:18 +00:00
Chris Lattner
98a6e485b0 * isFirstClassType is now provided by the Type class
* Add ReplaceInstWithInst

llvm-svn: 1468
2001-12-14 16:39:22 +00:00
Chris Lattner
553ec6b72f * 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
9e6ccdd858 Remove unsized array support
llvm-svn: 1466
2001-12-14 16:38:04 +00:00
Chris Lattner
cd134c6891 * 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
1dc9744cc7 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
315df5b058 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
831b4ac558 Allow pointer indexing
llvm-svn: 1462
2001-12-14 16:31:26 +00:00
Chris Lattner
43c92f9dbd Remove unsized array support
llvm-svn: 1461
2001-12-14 16:30:51 +00:00
Chris Lattner
8ab6f31913 Add pointer indexing support
llvm-svn: 1460
2001-12-14 16:30:09 +00:00
Chris Lattner
2cd50171de Don't waste as much horizontal space on #uses flag when printing
llvm-svn: 1459
2001-12-14 16:29:12 +00:00
Chris Lattner
a1ba456c49 * Fix cases where we were calling Type->getName() instead of Type->getDescription()
* Remove unsized array support
* Malloc/alloca do not require that the first element be an unsized array to be an
  array allocation

llvm-svn: 1458
2001-12-14 16:28:42 +00:00
Chris Lattner
6b2dc21b63 * 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
Ruchira Sasanka
58691e18af added a section on how to modify live variable code to use LLVM instructions
instead of machine instructions.

llvm-svn: 1451
2001-12-13 21:25:46 +00:00
Chris Lattner
e5172702f4 Not just arrays are unsized
llvm-svn: 1450
2001-12-13 00:46:11 +00:00
Chris Lattner
488f202019 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
44a0bf36c6 Some programs are using BB's as values, until we resolve this. Disable the assert
llvm-svn: 1448
2001-12-13 00:45:06 +00:00
Chris Lattner
eed30bc7da Build runtime library with local GCCAS
llvm-svn: 1447
2001-12-13 00:44:23 +00:00
Chris Lattner
472385127d Implement sprintf
llvm-svn: 1445
2001-12-13 00:43:47 +00:00
Chris Lattner
9a7dd44f2c Swap operands now preserves the semantics of the binary operator by changing
the opcode of the instruction if possible.

llvm-svn: 1444
2001-12-13 00:43:03 +00:00
Chris Lattner
9d4207dbaf Add debugging to make a more useful message if a value gets constructed with a null type
llvm-svn: 1443
2001-12-13 00:41:27 +00:00
Ruchira Sasanka
05aed40cfa Added more comments. Added code to destructor in MethodLiveVarInfo to delete
LiveVarSet caches.

llvm-svn: 1435
2001-12-08 21:05:27 +00:00
Ruchira Sasanka
9d26f00cfb Added comments are more documentation info
llvm-svn: 1434
2001-12-08 21:04:22 +00:00
Chris Lattner
d76171a512 Implement more general conversions for getelementptr instructions
llvm-svn: 1432
2001-12-07 04:40:30 +00:00
Chris Lattner
9ae054fd1a Remove code that is superceeded by code in ExprTypeConvert.cpp
llvm-svn: 1431
2001-12-07 04:39:01 +00:00
Chris Lattner
e3b8fb7426 Don't insert scales of 1 :)
llvm-svn: 1430
2001-12-07 04:26:02 +00:00
Chris Lattner
9421444244 Do not pessimize users of this function. Fix logic.
llvm-svn: 1428
2001-12-06 18:06:37 +00:00
Chris Lattner
e3b57cfe8f We can do cast-add elimination even on casts that reinterpret
llvm-svn: 1427
2001-12-06 18:06:13 +00:00
Chris Lattner
e23b6591f9 Fix bug that caused invalid transformations to be applied
llvm-svn: 1426
2001-12-06 18:05:55 +00:00
Chris Lattner
d89106f96b Actually return true when a change has been made
llvm-svn: 1425
2001-12-05 19:41:33 +00:00
Chris Lattner
8ca0f9efd6 Handle more complex array indexing expressions
llvm-svn: 1424
2001-12-05 19:41:16 +00:00
Chris Lattner
662a17ba5f Fix pessimizations on sized arrays
llvm-svn: 1423
2001-12-05 19:40:32 +00:00
Chris Lattner
57e64f9985 Fix a few bugs. Fix pessimization handling sized arrays
llvm-svn: 1422
2001-12-05 19:39:15 +00:00
Chris Lattner
fb6a288211 "fix" problems processing floating point expressions
llvm-svn: 1421
2001-12-05 19:38:29 +00:00
Chris Lattner
d1a8ed7d8c Hrm, don't do debugging output when debugging is off. :(
llvm-svn: 1420
2001-12-05 06:40:17 +00:00
Chris Lattner
05fb7c607f Fixes to type conversion stuff to match induction variables more frequently
llvm-svn: 1417
2001-12-05 06:34:00 +00:00
Chris Lattner
53fcedeb3c Fix a bug that clobbered the step value on some inputs
llvm-svn: 1416
2001-12-05 06:32:30 +00:00
Chris Lattner
7059b60173 Fix a bug introduced by "internal linkage" work.
llvm-svn: 1415
2001-12-04 18:01:49 +00:00
Chris Lattner
8ec5ceb110 Fix bugs, don't do external methods which causes segv.
llvm-svn: 1414
2001-12-04 08:13:06 +00:00
Chris Lattner
c1b018dcf4 Remove printouts
llvm-svn: 1413
2001-12-04 08:12:53 +00:00
Chris Lattner
83d8d32cfa Fix a pessimization due to sucky LI testing
llvm-svn: 1412
2001-12-04 08:12:47 +00:00
Chris Lattner
bd85988c94 Implement induction variable simplification
llvm-svn: 1411
2001-12-04 04:32:29 +00:00
Chris Lattner
d865a13064 Allow hyphens in identifier names
llvm-svn: 1409
2001-12-04 04:31:30 +00:00
Chris Lattner
c4a5815033 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