Commit Graph

3971 Commits

Author SHA1 Message Date
Chris Lattner
59e8de386d Improve documentation on throwing, it is not complete still though. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28294 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 19:07:07 +00:00
Chris Lattner
fd50080fe2 This is a proper fix for the compiler warning. A termination condition is
not needed, as it can never be reached: an edge must exist.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28282 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 02:01:22 +00:00
Reid Spencer
ca960c9946 Fix an infinite loop bug that Vladimir Prus identified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28281 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-13 18:11:32 +00:00
Reid Spencer
c7365a9ec9 Add a #include <cassert> for situations where Casting.h is used standalone.
Patch contributed by Vladimir Prus.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28280 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-13 17:50:38 +00:00
Evan Cheng
ee00a1d12c Revert an un-intended change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28278 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-13 05:53:47 +00:00
Reid Spencer
3e41da29fb Don't use old-style casts. This prevents compiler warnings when CommandLine.h
is used in projects that have stricter warning control than LLVM. This also
helps us find casts more easily if we ever need to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28263 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 19:20:55 +00:00
Owen Anderson
2577c22131 Add a method to generate a string representation from a TargetData.
This continues the work on PR 761.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28239 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 07:01:44 +00:00
Owen Anderson
07000c6f01 Refactor a bunch of includes so that TargetMachine.h doesn't have to include
TargetData.h.  This should make recompiles a bit faster with my current
TargetData tinkering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28238 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 06:33:49 +00:00
Evan Cheng
647c15e58e Backing out fix for PR770. Need to re-apply it after live range splitting is possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28236 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 06:06:34 +00:00
Owen Anderson
8f60c56a06 Add a new constructor to TargetData that builds a TargetData from its
string representation.

This is part of PR 761.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28234 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 05:49:47 +00:00
Evan Cheng
13d41b9d72 Add capability to scheduler to commute nodes for profit.
If a two-address code whose first operand has uses below, it should be commuted
when possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28230 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 01:58:24 +00:00
Evan Cheng
e165a78551 Refactor scheduler code. Move register-reduction list scheduler to a
separate file. Added an initial implementation of top-down register pressure
reduction list scheduler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28226 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-11 23:55:42 +00:00
Evan Cheng
c3580cace2 Also add super- register class info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28222 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-11 07:31:44 +00:00
Chris Lattner
b77780e11e Add alloca/malloc ctors that don't take array sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28211 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-10 04:38:35 +00:00
Chris Lattner
631a19d894 This method doesn't need to be virtual, thanks to Reid for pointing this out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28206 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 17:29:17 +00:00
Evan Cheng
e73701df94 PR 770 - permit coallescing of registers in subset register classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28197 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 06:37:48 +00:00
Evan Cheng
696736be8b Added sub- register classes information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28196 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 06:35:30 +00:00
Chris Lattner
b6c76ec46e Implement MASM sections correctly, without a "has masm sections flag" and a
bunch of special case code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28193 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:33:28 +00:00
Chris Lattner
f668ffc4c2 Split SwitchSection into the SwitchTo{Text|Data}Section functions, to better
support assemblers that distinguish the two.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28183 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 04:59:30 +00:00
Chris Lattner
683d1bb712 Move methods out of line so that MutexGuard.h isn't required in the header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28178 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 22:00:26 +00:00
Chris Lattner
023cfb6871 Move the definition of value_use_iterator::getOperandNo to User.h where the
definition of the User class is available, this fixes the  build with some
compiler versions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28163 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 05:59:36 +00:00
Nate Begeman
f01f31eceb Remove unncessary include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28160 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 01:33:11 +00:00
Chris Lattner
a0d513ba75 Add some new methods for computing sign bit information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28144 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-06 09:26:22 +00:00
Nate Begeman
7328797b16 Somehow, I missed this part of the checkin a couple days ago
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28116 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-05 01:13:11 +00:00
Chris Lattner
71fe0f4a43 Add a helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28114 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-05 00:51:42 +00:00
Chris Lattner
ed5b016f0e Fix this to be a proper copy ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28111 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 21:17:35 +00:00
Chris Lattner
6e994b7492 Final pass of minor cleanups for MachineInstr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28110 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 19:36:09 +00:00
Chris Lattner
943b5e117f Remove redundancy and a level of indirection when creating machine operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28107 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 19:14:44 +00:00
Chris Lattner
02597f3b88 Move register numbers out of "extra" into "contents". Other minor cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28106 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 18:25:20 +00:00
Chris Lattner
8b915b4ed2 Remove and simplify some more machineinstr/machineoperand stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28105 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 18:16:01 +00:00
Chris Lattner
2d90ac7ca6 Rename MO_VirtualRegister -> MO_Register. Clean up immediate handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28104 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 18:05:43 +00:00
Chris Lattner
68ab4c6367 remove hasAllocatedReg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28103 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 17:56:20 +00:00
Chris Lattner
e53f4a055f Move some methods out of MachineInstr into MachineOperand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28102 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 17:52:23 +00:00
Chris Lattner
63b3d7113d There shalt be only one "immediate" operand type!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28099 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 17:21:20 +00:00
Chris Lattner
ceb408f6a2 Change "value" in MachineOperand to be a GlobalValue, as that is the only
thing that can be in it.  Remove a dead method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28098 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 17:02:51 +00:00
Chris Lattner
4efeab208c Remove a bunch more dead V9 specific stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28094 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 01:26:39 +00:00
Chris Lattner
ea50fabfd4 Remove a bunch more SparcV9 specific stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28093 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 01:15:02 +00:00
Chris Lattner
34fb2cad46 Remove some more V9-specific stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28092 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 00:49:59 +00:00
Chris Lattner
10f3597c4e Remove some more unused stuff from MachineInstr that was leftover from V9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28091 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-04 00:44:25 +00:00
Chris Lattner
5a032de387 Change from using MachineRelocation ctors to using static methods
in MachineRelocation to create Relocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28088 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 20:30:20 +00:00
Chris Lattner
1e3822c776 Cleanup the internal implementation of MachineRelocation. No interface or
functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28086 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 18:52:31 +00:00
Chris Lattner
b4432f3d47 Suck block address tracking out of targets into the JIT Emitter. This
simplifies the MachineCodeEmitter interface just a little bit and makes
BasicBlocks work like constant pools and jump tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28082 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 17:10:41 +00:00
Owen Anderson
a69571c799 Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.
This fixes PR 759.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28074 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 01:29:57 +00:00
Chris Lattner
3db9e30c09 Add a new emitAlignment method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28072 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 01:01:51 +00:00
Chris Lattner
af1563fb62 Change the BasicBlockAddrs map to be a vector, indexed by MBB number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28069 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-03 00:32:55 +00:00
Chris Lattner
f75f9be3fb Several related changes:
1. Change several methods in the MachineCodeEmitter class to be pure virtual.
2. Suck emitConstantPool/initJumpTableInfo into startFunction, removing them
   from the MachineCodeEmitter interface, and reducing the amount of target-
   specific code.
3. Change the JITEmitter so that it allocates constantpools and jump tables
   *right* next to the functions that they belong to, instead of in a separate
   pool of memory.  This makes all memory for a function be contiguous, and
   means the JITEmitter only tracks one block of memory now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28065 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 23:22:24 +00:00
Chris Lattner
1f4549f35c Add a method for allocating space from the code buffer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28064 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 22:51:03 +00:00
Chris Lattner
f5d438c1f0 Do not make the JIT memory manager manage the memory for globals. Instead
just have the JIT malloc them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28062 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 21:57:51 +00:00
Chris Lattner
d3f0aefc33 Fix a purely hypothetical problem (for now): emitWord emits in the host
byte format.  This doesn't work when using the code emitter in a cross target
environment.  Since the code emitter is only really used by the JIT, this
isn't a current problem, but if we ever start emitting .o files, it would be.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28060 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 19:14:47 +00:00
Chris Lattner
43b429b059 Refactor the machine code emitter interface to pull the pointers for the current
code emission location into the base class, instead of being in the derived classes.

This change means that low-level methods like emitByte/emitWord now are no longer
virtual (yaay for speed), and we now have a framework to support growable code
segments.  This implements feature request #1 of PR469.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28059 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 18:27:26 +00:00