Commit Graph

1767 Commits

Author SHA1 Message Date
Chris Lattner
b2acc51bb2 * Multiplications by 2^X are turned into shifts. This factors code out of the
getelementptr code path for use by other code paths (like malloc and alloca).
* Optimize comparisons with zero
* Generate neg, not, inc, and dec instructions, when possible.

This gives some code size wins, which might translate into performance.  We'll
see tommorow in the nightly tester.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9267 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 21:09:10 +00:00
Chris Lattner
f634a103ee Add some new instructions. Wheee
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9266 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 19:25:35 +00:00
Chris Lattner
b169841166 .string adds an implicit zero at the end. This is not what we wanted.
This fixes PR#44.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9252 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 02:51:01 +00:00
Chris Lattner
a81fc68f8e Fix bug: Jello/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.llx
This also fixes miscompilation of 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9249 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 00:26:11 +00:00
Chris Lattner
4d45bd007d Add support for the new varargs intrinsics and instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9226 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 05:57:43 +00:00
Chris Lattner
7381506368 Add support for the new varargs intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9224 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 05:56:40 +00:00
Chris Lattner
8ad3946d74 Update the sparc backend to at least compile correctly with the new varargs stuff even if it's not all implemented yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9223 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 05:55:58 +00:00
Brian Gaeke
e5f6859911 You can't just blat the address into memory, you have to blat its
displacement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9210 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 21:47:25 +00:00
Brian Gaeke
9b8c2911d9 Implement replaceMachineCodeForFunction() for x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9204 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 18:27:46 +00:00
Brian Gaeke
4ca7e53690 Refactor jump insertion code from CompilationCallback() into insertJumpAtAddr().
Make insertFarJumpAtAddr() return void, because nothing uses its return value.
Remove some commented-out code.
Implement replaceMachineCodeForFunction() for SPARC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9203 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 18:27:37 +00:00
Brian Gaeke
9a7871bd3d Add prototype for replaceMachineCodeForFunction().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9202 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 18:27:25 +00:00
Brian Gaeke
578b68cc47 Remove extra blank line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9196 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 18:09:10 +00:00
Alkis Evlogimenos
60596382aa Eliminate some extraneous code in SlotCalculator::insertVal().
Rename SlotCalculator::getValSlot() to SlotCalculator::getSlot(),
       SlotCalculator::insertValue() to SlotCalculator::getOrCreateSlot(),
       SlotCalculator::insertVal() to SlotCalculator::insertValue(), and
       SlotCalculator::doInsertVal() to SlotCalculator::doInsertValue().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9190 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 02:02:40 +00:00
Brian Gaeke
45f0b6dd56 Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9187 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 23:45:05 +00:00
Chris Lattner
72ac148d49 Add support for 'weak' linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9171 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 18:29:00 +00:00
Chris Lattner
60fa583545 #include vector which we will need here soon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9144 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-15 22:09:32 +00:00
Chris Lattner
fd05924946 Decrease usage of use_size()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9135 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-15 16:48:29 +00:00
Chris Lattner
c2b81f69ed Output a contorted sequence of instructions to make sure that we don't access
off the bottom of the stack.  This fixes PR#41


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9114 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-14 19:09:05 +00:00
Chris Lattner
d5b7c47b27 Disable the leaf function optimization, which is apparently not legal on
X86/linux.  :(  The problem is that a signal delivered while the function
is executing could clobber the functions stack.  This is a partial fix
for PR41.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9113 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-14 18:52:41 +00:00
Chris Lattner
3875657ee5 Do not allow fallthroughs in switch statements. This fixes PR37,
253.perlbmk, and test/Programs/SingleSource/UnitTests/2003-10-13-SwitchTest.c!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9101 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 20:32:04 +00:00
Brian Gaeke
4296088ccf Remove WordsEmitted statistic; there's already a non-backend-specific
jello statistic for this (just divide #-bytes-of-code-emitted by 4).

Rewrite head-of-file comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9098 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 19:51:20 +00:00
Chris Lattner
4946a8cf56 Use the autoconf macro John wrote
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9095 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 17:13:53 +00:00
Chris Lattner
cf3056db0f Regularize header file comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9071 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 03:32:08 +00:00
Chris Lattner
5ef6ffd6c3 * Spell "necessary" correctly
* Print floating point values using C99 hexadecimal style FP if possible.
  This increases the number of floating point constants that may be emitted
  inline, and improves precision for global variable initializers which
  can not be emitted in integer form.

This fixes the Olden/Power benchmark with the CBE!!!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9052 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-12 08:12:58 +00:00
Chris Lattner
9860e77110 * Be TBAA safe
* Fix isFPCSafeToPrint to find more constants safe to print, which it was
  failing because ftostr was padding with leading space characters.
* Scan the entire module for global constants instead of each function at a
  time.  This has the advantage of allowing us to emit constants at global
  scope instead of function scope.  This speeds FP programs quite a bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9048 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-12 04:36:29 +00:00
Brian Gaeke
82a036fd19 Don't include "Config/stdlib.h".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9037 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 19:12:22 +00:00
Brian Gaeke
17634f7668 Include <cstdio> instead of <stdio.h>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9032 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 18:46:52 +00:00
Misha Brukman
cf00c4ab3b Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9027 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:57:28 +00:00
Misha Brukman
aa41c3ca20 * Doxygenified comments
* Wrap code at 80 columns
* Ordered includes according to LLVM style guide


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9020 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:41:32 +00:00
Brian Gaeke
2c9b913fc0 Add # of printed instructions statistic to both the SPARC and X86 LLC backends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8892 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-06 15:41:21 +00:00
Chris Lattner
d324e2501c Add support for the Invoke instruction by using the LowerInvoke pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8872 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-05 19:16:09 +00:00
Chris Lattner
c58c169eda Instead of hacking in custom support for Invoke/Unwind, use the LowerInvoke pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8871 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-05 19:15:47 +00:00
Chris Lattner
dd76acac3f A couple of minor code cleanups.
Print literal doubles using ftostr instead of <<, because it yields higher precision numbers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8855 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-05 00:40:51 +00:00
Alkis Evlogimenos
7237ecef13 Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8819 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-02 16:57:49 +00:00
Alkis Evlogimenos
eed462b685 Change llc command line for register allocators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8815 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-02 06:13:19 +00:00
Alkis Evlogimenos
77e78d050a Revert previous change. For some reason this went into the main branch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8805 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-01 19:40:13 +00:00
Alkis Evlogimenos
6ac2c8c673 Added command line option for linear scan allocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8804 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-01 19:38:10 +00:00
Misha Brukman
99b2d3d852 The comment seems irrelevant as the pass has become a BasicBlock pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8803 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-01 05:24:50 +00:00
Chris Lattner
56d225116f Make sure to get the definition of getRegisterAllocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8801 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-30 22:24:00 +00:00
Chris Lattner
9cd3fe9c6d RegisterAllocation.h is going away
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8795 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-30 20:15:04 +00:00
Chris Lattner
797c136607 include passes.h which defines the interface this file exposes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8793 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-30 20:13:59 +00:00
Brian Gaeke
f478556740 Add statistic for # of emitWord() calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8772 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-30 17:49:41 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Misha Brukman
103f0c3472 Added some optimizations:
* Generate a single BA instead of 6-instruction JUMP if possible
  (this occurs both in the creation and overwriting of the stub code)
* If possible, rewrite the ORIGINAL call to call the generated function
  directly, thus bypassing the stub entirely

Also added some statistics on how often calls are overwritten and how often the
CompilationCallback is invoked.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8376 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 22:59:31 +00:00
Chris Lattner
b7f7296cd9 OptInfo is no longer required
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:41:07 +00:00
Chris Lattner
84be5ad94a No longer provide an optinfo, noone uses it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8311 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:40:59 +00:00
Chris Lattner
a89d8f7468 Inline simple comparison which is sparc specific anyway
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8309 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:38:03 +00:00
Chris Lattner
67699ffe7f Move private interfaces into private .h file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8306 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:33:07 +00:00
Chris Lattner
e96e2630f3 Simplify code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8301 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:24:06 +00:00
Chris Lattner
84681f1184 LiveRange.h is now in lib/CodeGen/RegAlloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8299 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:17:13 +00:00
Chris Lattner
47c97513a8 This file is hopelessly out of date
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:14:00 +00:00
Chris Lattner
893f9541dc LiveRangeInfo got moved into the lib/CodeGen/RegAlloc directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8297 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:12:17 +00:00
Chris Lattner
70b2f56e76 PhyRegAlloc.h got moved to lib/CodeGen/RegAlloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8296 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:09:04 +00:00
Chris Lattner
c083dcccbf Move IGNode from public include directory to here. Minor cleanups like adding std:: namespace qualifiers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8295 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:05:47 +00:00
Chris Lattner
bcc6dec741 IGNode got moved to lib/CodeGen/RegAlloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8294 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 20:00:08 +00:00
Chris Lattner
fdba393cc0 This file just needs LiveRange.h not IGNode.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8293 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 19:58:02 +00:00
Chris Lattner
87d50f0566 No longer include IGNode.h in the Sparc global header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8292 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 19:56:48 +00:00
Misha Brukman
cfd67c96dc * Use alloca() to force GCC not to eliminate frame pointer
* Break apart saving and restoring registers into separate functions
* Instead of saving single and double FP registers, just save the double
  registers -- aliasing helps preserve the single FP registers as well.
* Request just as much memory for a stub as we actually use


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8200 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-29 04:22:54 +00:00
John Criswell
c9afb499f6 Fixed two double free bugs that caused llc to segfault or run forever.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8191 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 21:43:17 +00:00
Chris Lattner
aeb54b882c Add support for the llvm.unwind intrinsic, which we codegen to just do an abort
until we implement unwinding.
Add support for the invoke instruction, which codegens just like a call with
a branch after it.

The end effect of this change is that programs using the invoke instruction,
but never unwinding, will work fine.  Programs that unwind will abort until
we get unwind support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8187 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 21:23:43 +00:00
Chris Lattner
fd04561e1b Fix really nasty bugs in the CWriter, handling invoke instructions. Tracking
these down was NOT phun.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8181 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 19:56:10 +00:00
Tanya Lattner
3b6b6ba4be Removing README
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8180 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 17:17:59 +00:00
Tanya Lattner
4f839ccf49 Putting my revised version of ModuloScheduling in cvs. This is not complete...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8179 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 17:12:14 +00:00
Tanya Lattner
8dc9982e2e Moved index into BB to common graph class because its needed by ModuloSchedGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8174 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 15:30:40 +00:00
Tanya Lattner
d6d863392f Added/removed header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8160 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-27 15:12:24 +00:00
Tanya Lattner
c50ee556e5 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8153 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-27 02:42:58 +00:00
Tanya Lattner
b6489f3153 First version of SchedGraph common class and refactoring of SchedGraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8148 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-25 22:42:20 +00:00
Chris Lattner
5864da0871 Simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8139 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 21:00:22 +00:00
Chris Lattner
bb144a892b Targets should configure themselves based on a Module, not some wierd flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8132 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 19:49:48 +00:00
Chris Lattner
58c41fe687 Implement: Jello/test-constantexpr.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8127 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 19:19:47 +00:00
Chris Lattner
030574fd35 Add support for 'any' pointer size and endianness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8120 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 13:49:22 +00:00
Chris Lattner
e55497cd04 Implement support for the unwind intrinsic in the CBE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8116 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 13:06:10 +00:00
Misha Brukman
ef6a6a69ff The word dependent' has no a'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8030 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 22:14:26 +00:00
Chris Lattner
e287cfdfd0 Fix spello
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8029 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 22:05:57 +00:00
Chris Lattner
f3526e2207 Change all #include'd files to be :: rules instead of : rules
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8019 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 20:37:17 +00:00
Chris Lattner
72af6b8e5d Add support for the sig(set|long)jmp intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7951 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 16:06:09 +00:00
Misha Brukman
5560c9d49c Spell `necessary' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 14:43:39 +00:00
Chris Lattner
7540565863 Fix ABI issue: Longs really do need to be only 4 byte aligned on X86.
This bug caused miscompilation of programs using 'struct stat', but only if
compiled with support for 64-bit filesystems.  This could in theory effect
other things, but only if the LLVM code shared data structures with native code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7928 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-17 23:20:40 +00:00
Brian Gaeke
77d2f511c0 Rename -emitmaps to -enable-maps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7913 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-16 00:23:16 +00:00
Misha Brukman
d2dfc9628d Now that the JIT memory manager allocates as many bytes as necessary rather than
rounding up to a page, we need to request (num instrs * 4) bytes. However, I
think that 64 bytes is overkill for the stub function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7888 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 18:03:06 +00:00
Misha Brukman
15d1d57f61 Fix register and parameter numbers in saving double FP registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7884 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 16:15:28 +00:00
Chris Lattner
e3561c23c2 Remove uses of the NonCopyable class, to make the doxygen output look better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7880 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 05:20:06 +00:00
Chris Lattner
f3c274d4a6 Adjust to new API, add expandCall stub
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7873 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 04:51:59 +00:00
Chris Lattner
51970b2734 Add support for unconditional branches and for emitting JE instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7872 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 04:50:49 +00:00
Chris Lattner
b6ef5c860c Add a bunch of new node types, including a new Void dummy register class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7870 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 04:35:14 +00:00
Misha Brukman
fad4929ee2 * Must save FP registers when calling CompilationCallback(), because FP
registers are global, are NOT windowed, and hence can be clobbered!
* Removed unused register shorthand notations
* Fixed and cleaned up comments in inline assembly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7853 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-15 00:26:50 +00:00
Vikram S. Adve
891bd82e79 Improvement to the previous fix: branch following a delay slot of
another delayed instr. would cause the later sanity-check (assertion)
in PhyRegAlloc.cpp to fail, even though there is really no error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7848 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 20:45:56 +00:00
Chris Lattner
2925592230 Stop annoying warnings about mismatched types with the argument of a free
implement more constant expressions so that 176.gcc compiles with the CBE


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7847 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 19:19:53 +00:00
Misha Brukman
640b9280d5 Since we now have TableGen editing modes for VIM and (X)Emacs, we no longer need
to mark TableGen description files with "C++ mode".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7841 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 15:16:28 +00:00
Chris Lattner
a8e40f54e5 Restore 'nice name' to pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7840 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 14:43:24 +00:00
Brian Gaeke
bf3c4cfaad Factory methods for function passes now return type FunctionPass *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7839 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 06:09:32 +00:00
Brian Gaeke
e69f72758b Unbreak SPARC backend: addPassesToJITCompile and
addPassesToEmitMachineCode now both take a FunctionPassManager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7837 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 06:04:59 +00:00
Brian Gaeke
277aad2655 Factory methods for function passes now return type FunctionPass *.
Get rid of RegisterLLC, which can't handle FunctionPasses anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7836 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 06:04:49 +00:00
Brian Gaeke
d7d6bbe697 Unbreak SPARC backend: addPassesToJITCompile and
addPassesToEmitMachineCode now both take a FunctionPassManager.
Factory methods for function passes now return type FunctionPass *.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7835 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 06:04:29 +00:00
Brian Gaeke
3e3c805a82 X86 static backend: smacked
Function at a time: smacked

Who you gonna call!!!  :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7826 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 19:02:09 +00:00
Brian Gaeke
19df3876e6 Factory methods for FunctionPasses now return type FunctionPass *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7823 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:18:15 +00:00
Brian Gaeke
8844a0ba89 addPassesToJITCompile and addPassesToEmitMachineCode now take a
FunctionPassManager, to support function-at-a-time compilation and
 emission of code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7821 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:17:27 +00:00
Brian Gaeke
b428654076 addPassesToJITCompile now takes a FunctionPassManager, to support
function-at-a-time compilation and emission of code.
Separate addPassesToEmitAssembly from addPassesToJITCompile, because
 the latter requires you to use FunctionPasses, and the former might
 diverge anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7817 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:15:52 +00:00
Brian Gaeke
9826bdb7d8 Factory methods for FunctionPasses now return type FunctionPass *.
Correct one of the functions' comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7816 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:15:29 +00:00
Brian Gaeke
9d99b43fbc Factory methods for FunctionPasses now return type FunctionPass *.
Revert (to v1.55) one of the hunks of Chris's change that messed up the
 %-register workaround.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7815 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:15:15 +00:00
Chris Lattner
48e6079478 Adjust files for move of mapping info stuff into the Sparc directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7802 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 02:38:16 +00:00
Brian Gaeke
99c27d7686 Just incorporating some notes I wrote for myself into a place where they won't
get lost...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7798 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 00:30:48 +00:00
Vikram S. Adve
feb3298fca For instructions in a delay slot of another instruction,
we no longer need to find the live-before set of the delayed
branch since that set is now included the live-before/after
set of the instructions in each delay slot.  Just assert that instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7796 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 22:22:24 +00:00
Vikram S. Adve
88d962aa58 For an instruction with delay slots, mark all live values before
the instruction as being live before/after the delay slot
instructions as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7795 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 22:19:59 +00:00
Vikram S. Adve
20a3be3ba8 Disable emitting LLVM-to-MI maps, by default.
Add -emitmaps options to turn this back on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7774 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 15:51:02 +00:00
Chris Lattner
c12a61463a Rename DNVT_bool to DNVT_i1 to be consistent with type system
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7768 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 04:28:21 +00:00
Chris Lattner
c8477960b0 Add support for basicblocks, setCC instructions, and branches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7767 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 04:17:29 +00:00
Vikram S. Adve
9d27514a21 Fix va_arg to generate LDDFi for floating point values, instead of LDXi.
All non-FP cases use LDXi as before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7765 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 03:04:05 +00:00
Chris Lattner
00b40943ab Add basic support for 16 and 32 bit function arguments!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7755 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 21:30:00 +00:00
Chris Lattner
c0bb13dc82 add frameidx support
Make load work
Make type inference infer from Arg1 to arg0 as well as from arg0 to arg1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7754 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 21:29:40 +00:00
Chris Lattner
d59414fc85 Sort #includes, eliminate #include of "llvm/Type.h" which was redundant
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7746 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 20:06:16 +00:00