Commit Graph

4416 Commits

Author SHA1 Message Date
John Criswell
ead9a945ea Moved code from llvm/lib/Support to llvm/support/lib/Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8735 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-29 15:02:30 +00:00
Chris Lattner
b0b7c0d28c Just rethrow previous exception instead of making a new one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8718 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-26 14:44:52 +00:00
Chris Lattner
735289ccf0 Define the instance variable Buffer, not the automatic variable Buffer.
This was causing us to munmap random stuff, which is obviously bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8709 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-25 04:13:53 +00:00
Chris Lattner
fbc2d84ce9 DOn't crash if program calls the null pointer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8708 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 23:42:58 +00:00
Chris Lattner
4eed793d5a Fix alignment problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8707 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 22:34:17 +00:00
Chris Lattner
03f252f1eb Remove explicit use of BasicBlock::succ_iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8706 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 22:18:35 +00:00
Misha Brukman
134aba6a75 Actually assign the string correctly through the std::string pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8704 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 22:10:47 +00:00
Chris Lattner
23ed9c1c97 Use global *_iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8703 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 22:07:33 +00:00
Chris Lattner
f8b5b6ddb4 Do not use BasicBlock::*_iterator, just use *_iterator itself.
Isn't updating copy and pasted code a joy


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8702 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 22:06:25 +00:00
Misha Brukman
34ce14b019 * Eliminate BytecodeBufferReader::Length member variable
* Kill unused ALIN_PTRS #define
* Set the error string if user passed it in to be compatible with former API


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8701 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 22:04:02 +00:00
Chris Lattner
1c9ab515de Do not use BasicBlock::succ_iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8700 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 22:03:22 +00:00
Brian Gaeke
222bd53c2c Update head-of-file comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8699 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 18:16:23 +00:00
Brian Gaeke
6a256cc37c Untabify tabs in stuff I've recently added.
Check in my register allocator state-saving code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8698 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 18:08:54 +00:00
Brian Gaeke
59b1c566c9 Use getRegClassID() instead of getRegClass()->getID(), since it's there.
Shorten the markSuggestedColorUsable method.
Add a switch for saving reg. alloc. state (coming soon).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8697 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 17:50:28 +00:00
Brian Gaeke
eefaeb84f1 Remove some unused methods of class IGNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8696 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 04:29:52 +00:00
John Criswell
4dcbd5e9a2 Added code that ensures that we pass the beginning of the data buffer to
the parsing routines regardless of whether the buffer is re-aligned or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8693 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-23 21:19:11 +00:00
Chris Lattner
332ae7f501 Fix bug: IndVarsSimplify/2003-09-23-NotAtTop.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8689 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-23 20:26:48 +00:00
Misha Brukman
452db67a0e Fixed spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8687 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-23 17:28:11 +00:00
Misha Brukman
8b2fe1943c Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8686 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-23 17:27:28 +00:00
Misha Brukman
d554ebfcf7 Stop returning bool and pass Instruction by reference;
return std::auto_ptr and use exceptions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8684 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-23 16:17:50 +00:00
Misha Brukman
e0dd0d47cb Suggestions made by Chris:
* Instead of a #define, use inline function
* Fix the name on the #define, errr... now inline function to be more logical:
  it doesn't CHECK the alignment, it PERFORMS the alignment
* To get string name of a Type*, use getDescription(), not getName()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8683 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-23 16:15:29 +00:00
Misha Brukman
d57308a33c * Group class definitions & implementations together
* Make sure we align the buffer we're given
* Do not let exceptions propagate when the caller asks for a Module*
* Add doxygenified comments to wrapper functions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8682 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-23 16:13:28 +00:00
Chris Lattner
8474f6fcda Move getAnalysisUsage method from header to .cpp file. Add a normal file
header comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8679 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-23 15:13:04 +00:00
Misha Brukman
5c344415fa * Constantify arguments to copy function
* Stop using a #define, make it an inline if statement


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8678 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-23 15:09:26 +00:00
Misha Brukman
96f7877d19 Removed no longer used member variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8677 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 23:58:08 +00:00
Misha Brukman
3229991165 Uppercase the acronym ASCII.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8676 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 23:50:25 +00:00
Misha Brukman
464537936d Added file header comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8675 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 23:44:46 +00:00
Misha Brukman
238fb25004 * No longer initialize the module, a subclass is more suitable to do this
because it can add a module ID which we do not have at this time.
* Check to see if the module has been initialized when materializing it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8674 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 23:44:13 +00:00
Chris Lattner
23219d1dcb Update file header for renamed file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8673 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 23:42:00 +00:00
Misha Brukman
12c29d10bb * Cleaned up code:
- no more passing around a string pointer to set errors
  - no more returning booleans and checking for errors, we use C++ exceptions
* Broke functionality into 2 new classes, one reads from file, one from a stream
* Implemented lazy function streaming - the parser can read in a function at-a-time


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8671 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 23:38:23 +00:00
Chris Lattner
dd7036d19a Fix bugs in the last change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8667 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 23:30:59 +00:00
Chris Lattner
f98a084908 Fix bug: Inline/2003-09-22-PHINodesInNormalInvokeDest.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8666 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 22:35:39 +00:00
Chris Lattner
51d6816089 Fix bug: Inline/2003-09-22-PHINodesInExceptionDest.ll
... by making sure to update PHI nodes to take into consideration the
extra edges we get if we inline a call instruction through an invoke.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8664 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 21:59:27 +00:00
Misha Brukman
22b9aab760 Credits now go into the top-level CREDITS.TXT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8662 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 21:57:56 +00:00
Misha Brukman
763f5ae902 Credits are now in top-level CREDITS.TXT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8661 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 21:57:15 +00:00
Chris Lattner
021c190f8d Squelch warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8659 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 20:33:34 +00:00
Vikram S. Adve
4d436c1a41 Fix assertion so it doesn't not trip incorrectly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8650 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 07:55:27 +00:00
Brian Gaeke
bd353fb662 Use C++ math header instead of C version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8648 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 03:57:37 +00:00
Brian Gaeke
37bc4cce9b Erase now-unused prototypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8647 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 02:51:00 +00:00
Brian Gaeke
874f423f54 Rearrange #includes ... since there are fewer now I guess it's a win.
(I also zapped printMachineCode() and printLabel() at the previous checkin,
but forgot to mention it.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8646 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 02:50:21 +00:00
Brian Gaeke
5779ef2ce0 Standardize the names of include guards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8645 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 02:31:37 +00:00
Brian Gaeke
fdb2596c77 Standardize the names of include guards.
Remove more excess whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8644 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 02:31:25 +00:00
Brian Gaeke
6264fb70c1 Standardize the names of include guards.
Fix typos in file header comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8643 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 02:31:15 +00:00
Brian Gaeke
43ce8fe477 I tried to standardize the formatting and tidy up the huge amount of
excess whitespace a little. Also improved some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8642 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 02:24:09 +00:00
Brian Gaeke
4efe342424 Convert PhyRegAlloc into a proper pass.
PhyRegAlloc.cpp:
 Don't include TargetMachine.h or TargetRegInfo.h, because these are provided
  by PhyRegAlloc.h.
 Merge class RegisterAllocator into class PhyRegAlloc.
 Simplify & move ctor, dtor to PhyRegAlloc.h.
 Make some of PhyRegAlloc's reference members into pointer members,
  so they can be more easily messed with.
 MarkAllocatedRegs() becomes a member method, with fewer args.

PhyRegAlloc.h:
 Include Pass.h, TargetMachine.h and TargetRegInfo.h. Don't declare
  TargetRegInfo forward.
 Give AddedInstrns the obvious clear() method.
 Make some of PhyRegAlloc's reference members into pointer members,
  so they can be more easily messed with.
 Add prototype for markAllocatedRegs().
 Remove unused inline void constructLiveRanges().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8641 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-21 01:23:46 +00:00
Chris Lattner
11fc9301fb Functions reachable from the arguments of unresolvable call nodes should
not have their arguments marked complete


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8639 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 23:58:33 +00:00
Chris Lattner
ec157b7cde The Globals graph must become complete at the end of the BU phase!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8638 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 23:27:05 +00:00
Chris Lattner
3b0a9be238 Do not mark incoming arguments to functions complete if the function is pointed to by a global in the globals graph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8637 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 22:24:04 +00:00
Chris Lattner
26c4fc3b69 Make sure to add global variable initializers to the Globals graph!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8636 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 21:48:16 +00:00
Chris Lattner
9970bf6288 Don't consider incomplete nodes to be typesafe!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8635 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 21:48:01 +00:00
Chris Lattner
bab8c28924 Remove trivially dead nodes was not removing nodes that were dead due to forwarding!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8634 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 21:34:07 +00:00
Chris Lattner
a2d51afd79 Global variables with APPENDING linkage are very important to keep around!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8632 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 19:00:50 +00:00
Chris Lattner
894263bc9f Add special case handling for calloc and realloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8630 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 16:50:46 +00:00
Chris Lattner
808a7aeec7 Switch from using CallInst's to represent call sites to using the LLVM
CallSite class.  Now we can represent function calls by invoke instructions
too!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8629 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 16:34:13 +00:00
Chris Lattner
192cd9cccd Make this work better for constants that aren't necessarily in ANY graph, such as null pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8628 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 16:12:57 +00:00
Chris Lattner
02a3be020a Rename Function::getEntryNode -> getEntryBlock
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8625 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 14:39:18 +00:00
Chris Lattner
ab4536e353 Minor cleanups, no functional changes
Rename Function::getEntryNode -> getEntryBlock


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8623 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 14:36:23 +00:00
Chris Lattner
d452ebd0bf Fix a really obvious huge gaping bug, add a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8620 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 05:24:00 +00:00
Chris Lattner
3fc6ef1bb9 Expose the TCE pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8619 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 05:14:13 +00:00
Chris Lattner
2240d2b3f7 New transformation: tail recursion elimination
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8618 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 05:03:31 +00:00
Chris Lattner
c1820036bd Fix bug: BasicAA/2003-09-19-LocalArgument.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8615 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 03:08:47 +00:00
Chris Lattner
7892549796 Keep track of the number of typed/untyped memory accesses theyre are in the program
VS: ----------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8611 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 01:20:46 +00:00
John Criswell
71478b7f72 Removed linking functionality from gccld.cpp and moved it to linker.cpp.
Renamed functions that were all lower-case.
Moved functions from util.cpp into linker.cpp or gccld.cpp.
Removed util.h and created gccld.h.
Refactored the linker functionality in linker.cpp so that it is easier to
follow, easier to modify, and it's library/object file search behavior is
easier to understand and document.
Added code to include library paths when doing native linking, but this
causes problems and is currently #ifdef'd out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8609 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-19 20:24:23 +00:00
Chris Lattner
095e907125 Reject "llvm." as a function name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8608 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-19 19:31:41 +00:00
Chris Lattner
62a355cc6e Implement InstCombine/and.ll:test(15|16)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8607 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-19 19:05:02 +00:00
Chris Lattner
bd7b5fff82 pull a large nested conditional out into its own function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8605 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-19 17:17:26 +00:00
Chris Lattner
9d5890d435 Implement InstCombine/add.ll:test(15|16)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8604 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-19 15:35:42 +00:00
Brian Gaeke
79c980399e Fix a typo in Sparc.cpp.
Update names of some pass creator fns in addPassesToEmitAssembly().
FunctionInfo is gone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8599 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-18 17:37:46 +00:00
Brian Gaeke
b92c5c0c15 Rename the pass creator fn to mimic the other creator fn names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8598 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-18 17:37:35 +00:00
Brian Gaeke
866dc1def7 Fix (and properly doxygenify) some comments. Incorporate
functionality of FunctionInfo pass as doFinalization method.
Rename pass to match names of other passes like it.
Rename the pass creator fn to mimic the other creator fn names.
Include StringExtras for utostr().
Make symbol prologue/epilogue stuff redundant with
 EmitBytecodeToAssembly, in preparation for refactoring.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8597 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-18 17:37:25 +00:00
Brian Gaeke
bb7cd97d53 Make the symbol prologue/epilogue stuff redundant with MappingInfo, in
preparation for refactoring.
Rename the pass creator fn to mimic the other creator fn names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8596 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-18 17:37:14 +00:00
Misha Brukman
521f1feb11 Minimal implementation of the abstract ModuleProvider interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8594 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-18 16:17:06 +00:00
Misha Brukman
6eba07a6a3 Fixed spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8588 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-17 21:34:23 +00:00
John Criswell
e5b3e1559b In ExecWait(), made the child process exit if it can't execve() the new
program.
Added the use of const (which compiles and is hopefully correct).
Added comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8585 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-17 19:02:49 +00:00
Chris Lattner
63bd61330b Change FunctionInfo from being an annotation put on Functions to be
something which is mapped from functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8580 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-17 17:26:22 +00:00
John Criswell
5afb5f6377 Added the ExecWait() function. It executes a program with the specified
arguments and environment.
Perhaps it should be merged with the RunProgramWithTimeout function, but I'd
want to allow it to inherit the parent process's stdin and stdout.
I'll save that for a rainy day...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8577 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-17 15:13:59 +00:00
Chris Lattner
0981b62eec Change the semancics of the dropallrefs method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8572 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-17 04:58:59 +00:00
Chris Lattner
cc838348fc Fix bug raising allocations whose call sites were invoke instructions.
Thanks to brg for tracking down the problem so precisely!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8568 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 19:42:21 +00:00
Chris Lattner
1cbcd0fd48 This is effectively a complete rewrite of the globaldce algorithm, resulting
in it being both shorter and more effective.  It no longer depends on the
callgraph, so one FIXME has been fixed.

Additionally, this pass was not able to delete recursive (but dead) functions
if they were pointed to by global variables which were also dead.  In fact
this pass had a lot of problems deleting functions which were only pointed
to by dead globals and other stuff.

Fixing this means that the entire EH library should be stripped away now from
programs that don't use sjlj or exceptions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8567 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 19:27:31 +00:00
Brian Gaeke
c86e84bcf3 Add missing apostrophe. It's been bugging me for years.
No really, years.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8566 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 18:00:35 +00:00
Brian Gaeke
305f02dd64 Fix typo in comment. Take out some random whitespace.
(Partial merge from my working file)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8564 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 15:38:05 +00:00
Brian Gaeke
d0534a863a Edit comment for accuracy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8562 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 15:36:50 +00:00
Misha Brukman
950971dfe6 Fixed spelling & grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8559 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 15:31:46 +00:00
Vikram S. Adve
5be7434c8b Fix longjmp case so that, along with the call to abort(), we also
generate the appropriate CallArgsDescriptor and tmp. virtual regs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8554 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 05:56:22 +00:00
Vikram S. Adve
bed4effb84 Add flag to control whether or not delay slots are filled during
instruction scheduling (this is off by default).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8553 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-16 05:55:15 +00:00
Chris Lattner
bdbecac051 Fix problems with programs that prototype printf to something unusual
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8538 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 16:47:12 +00:00
Chris Lattner
77b398cd5f Minor cleanups, give credit, remove code that should not be necessary, and
was a "major hack"  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8524 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 05:43:05 +00:00
Brian Gaeke
41de073b04 Fix typos in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8523 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 05:28:42 +00:00
Chris Lattner
6420f1cd50 Initial checkin of the Setjmp/Longjmp lowering/transformation pass,
contributed by the masterful Bill Wendling!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8520 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 04:56:27 +00:00
Chris Lattner
c9d3e5721b Ugh, a bug fix needed because of the bug in the CallGraph code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8519 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 04:52:00 +00:00
Chris Lattner
f52d01bbc5 These two conditions are not exclusive!!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8518 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 04:35:16 +00:00
Chris Lattner
b31247a840 Make the print output more useful
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8517 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 04:29:37 +00:00
Chris Lattner
ad9b5f31ea Fix bug: PruneEH/2003-09-14-ExternalCall.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8516 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 02:22:50 +00:00
Chris Lattner
e07007c2bd Fix bug: Inline/2003-09-14-InlineValue.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8514 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 02:10:16 +00:00
Chris Lattner
abe83ae992 Fix a spello Misha made while fixing one of my appostrifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8510 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 00:33:20 +00:00
Chris Lattner
a497748fb1 Make sure to cannonicalize loops before running indvar simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8502 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-12 16:45:01 +00:00
Chris Lattner
8fce16ef1a Do not return success after checking only the FIRST USE of a gep instruction.
Instead, check all uses.
This fixes bug: ScalarRepl/2003-09-12-IncorrectPromote.ll
This also fixes the miscompilation of Ptrdist/bc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8493 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-12 16:02:12 +00:00
Chris Lattner
fe7ea0da17 Minor optimization efficiency improvement:
- Run mem2reg promotion first
  - Only rerun passes if the previous thing changed something


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8490 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-12 15:36:03 +00:00
Misha Brukman
37f92e2568 Fixed spelling and grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8489 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 22:34:13 +00:00
Chris Lattner
515c97c230 Simplify code
Implement InstCombine/mul.ll:test9


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8488 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 22:24:54 +00:00
Misha Brukman
2f2d06506c Fixed spelling and grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8478 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 18:14:24 +00:00
Misha Brukman
3cfb6b13c0 Apostrophes are only used for possession and quoting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8473 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 16:58:31 +00:00
Chris Lattner
38aec32560 Integrate functionality of the mem2reg pass directly into this pass to make
the combination more effective


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8471 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 16:45:55 +00:00
Chris Lattner
c444a4228f Renamed DominatorTree::Node::getNode() -> getBlock()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8469 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 16:26:13 +00:00
Misha Brukman
352361b409 Spell `definite' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8467 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 15:32:37 +00:00
Misha Brukman
7bc439a4b6 Spell `definitely' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8466 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 15:31:17 +00:00
Misha Brukman
36d10ef7e7 * Move include files from middle of file to the top where they belong, moving
the #define up there too
* Since we're including system headers, use the ones in include/llvm/Config
* While we're here, use the canonical LLVM header ordering algorithm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8463 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:52:05 +00:00
Chris Lattner
545a76ced8 Unwind instructions are intrinsically alive, just like returns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8462 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:38:14 +00:00
Chris Lattner
b884f597d6 Rework dominator interfaces to handle changes in the post-dominance
construction.  Now there may be multiple root blocks, and null is a
special node used to mark the "virtual" exit node of a CFG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8461 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:37:51 +00:00
Chris Lattner
706e61ead9 Rework post dominator information so that we do not have to
unify all exit nodes of a function to compute post-dominance information.
This does not work with functions that have both unwind and return nodes,
because we cannot unify these blocks.  The new implementation is better
anyway. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8460 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:37:08 +00:00
Chris Lattner
1df2998451 Update for new UnifyFunction... API
Remove using decl


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8458 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:35:33 +00:00
Chris Lattner
4ea31ca391 Remove #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8457 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:35:21 +00:00
Chris Lattner
f46057be77 Expand the pass to unify all of the unwind blocks as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8456 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:34:51 +00:00
Chris Lattner
d0b52cf3e7 Remove a bunch of warnings from the CBE generated C code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8455 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:12:09 +00:00
Chris Lattner
4b2a71d621 "the one true solution for compatibility with GCC 3.3+"
... or so I hope


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8454 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:08:00 +00:00
Chris Lattner
b787e13e73 Be a little more specific about what is begin generated. Only print
command line if VERBOSE=1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8453 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 19:52:54 +00:00
Chris Lattner
b3aad5d28f Only emit inter-field-padding if the amount of padding is != 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8452 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 19:52:24 +00:00
Brian Gaeke
053134a1ee Make createVerifierPass return a FunctionPass *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8449 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 19:37:04 +00:00
Chris Lattner
2446b0aaaf Remove using declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8442 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 16:08:03 +00:00
Misha Brukman
88b4855499 Fix warning when _POSIX_MAPPED_FILES is already defined in unistd.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8436 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 15:09:45 +00:00
Chris Lattner
a176a8bb39 another trivial cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8435 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 14:55:05 +00:00
Chris Lattner
44abf85ae7 Simplification of trip counting machinery.
- make sure to check the indvar type before anything else (efficiency)
  - Make sure to insert the 'add' into the program, even though it'll be
    dead
  - Wrap code at 80 columns
  - Other minor cleanups to reduce indentation level


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8434 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 14:51:49 +00:00
John Criswell
1a51956d11 Don't explicitly use $SourceDir to find the tblgen files. This causes make
some confusion when trying to generate files (it probably couldn't tell that
./file and $(SourceDir)/file may be the same file).
Now, just let VPATH find everything, and list the primary tblgen file first in
the list of dependencies so that we can just use $< to reference it in the make
rule.

This should hopefully fix the nightly tester.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8433 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 14:10:44 +00:00
Chris Lattner
065a616ada Fix spell-o's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8431 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 05:29:43 +00:00
Chris Lattner
3adf51d022 Spelling fixes. I think that "cannonical" is ok, but "canonical" appears to
be the canonical form for the word


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8430 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 05:24:46 +00:00
Chris Lattner
69ecd0d7e7 Spelling fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8429 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 05:24:09 +00:00
Chris Lattner
c01ccfd503 Fix up file header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8428 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 05:10:34 +00:00
Chris Lattner
f6e5233fc7 clean up file header comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8427 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 05:08:19 +00:00
Chris Lattner
36836a6eb2 Simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8426 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 04:49:10 +00:00
Misha Brukman
dfa5f83c8e Spell `occurrence' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8425 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-09 21:54:45 +00:00
John Criswell
410d1b5dea Updated to find source files using VPATH. This makes writing build rules
much cleaner and easier.
Labeled .td as a suffix for tblgen files in Makefile.rules.
Modified build rules so that source files generated during the build are placed
in the build directory and not the source directory (and not in a Debug
directory).  This makes the system cleaner and allows us to have a read-only
source tree.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8424 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-09 20:57:03 +00:00
John Criswell
531922aaca Reverting back to the previous revision.
We want to check for length 5 because we might get the "llvm." string as the
name.  That string is in the LLVM namespace and should be checked as such.
We also don't have to worry about garbage data because (I believe) the string
class will return a valid value.  So, the switch statement will work and we
don't have to worry about the code wandering into segfault land.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8419 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-09 16:58:41 +00:00
John Criswell
21ca6ee7cd Modified the check for intrinsic functions. All intrinsic functions have to
be at least 6 characters, since something must follow the "llvm." string in the
function name.
This seems to fix an assertion failure with the SingleSource tests, too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8418 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-09 16:36:09 +00:00
Chris Lattner
ad20071559 * Simplify printConstantValueOnly by moving the tail padding stuff directly
into the struct case.
* Extend printConstantValueOnly to print .zero's if the initializer is zero
* Delete dead isConstantFunctionPointerRef function
* Emit the appropriate assembly for the various linkage types!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8417 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-09 16:23:36 +00:00
Chris Lattner
79ad13808b Oops, look at the VOLATILE marker, not the opcode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8413 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 20:29:46 +00:00
Chris Lattner
ee5457cbe8 Eliminate support for the llvm.unwind intrinisic, using the Unwind instruction instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8411 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 19:44:26 +00:00
Chris Lattner
da73beac20 Fix bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8410 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 19:43:46 +00:00
Chris Lattner
e4d9096409 Should invokify is always true
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8409 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 19:00:30 +00:00
Chris Lattner
36143fc444 Add support for the unwind instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8408 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:54:55 +00:00
Chris Lattner
a6ce898dad Add support for unwind
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8407 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:54:36 +00:00
Chris Lattner
15c9c0352e Parse volatile loads/stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8402 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:20:29 +00:00
Chris Lattner
dba2b225c8 Read volatile loads/stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8401 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:20:14 +00:00
Chris Lattner
bd9df30983 Remove a bunch of unneeded stuph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8400 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:19:58 +00:00
Chris Lattner
61c1e7e32d Do not hoist volatile loads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8399 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:17:14 +00:00
Chris Lattner
bd70a31c51 Fix bug: RLE-Preserve-Volatile.ll
Volatile loads and stores must not be value numbered


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8398 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:13:58 +00:00
Chris Lattner
09bd025762 Remove a gross hack that was there to support bytecode files that are over a year old.
If you still have these suckers laying around, you have GOT to rebuild them.  geeze.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8395 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:04:16 +00:00
Chris Lattner
0fe56f42ab Add support for writing volatile load/stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8394 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 17:58:37 +00:00
Chris Lattner
e5e475e09d Add support for volatile loads/stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8393 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 17:45:59 +00:00
Misha Brukman
c6315d9b27 Spell `occurrence' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8388 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 03:08:43 +00:00
John Criswell
69077e28d7 Checkin of autoconf-style object root.
Adjusted Makefile to work with new autoconf-style object root.
Specifically, use the new -I option of tblgen to find include files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8379 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-06 14:50:22 +00:00