Commit Graph

7229 Commits

Author SHA1 Message Date
Nate Begeman
8c541bcc56 Remove fixed item
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34081 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-09 04:19:54 +00:00
Evan Cheng
6a9a76508c This is done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34072 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-08 23:53:38 +00:00
Andrew Lenharth
ac5a545043 return addresses, those I already have
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34056 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-08 17:37:41 +00:00
Bill Wendling
2f5bcb5f38 Fixed comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34040 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-08 06:05:08 +00:00
Bill Wendling
eb1ac33850 Moved the MachOWriter and ELFWriter out of the Target/* files. Placed the
definition of it into the CodeGen library. This is so that a backend doesn't
necessarily add in these writers if it doesn't use them (like in the lli
program).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34034 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-08 01:39:44 +00:00
Bill Wendling
50e4e88d97 Added new method to add a "simple" code emitter. That is, to only add
the code emitter and not set variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-08 01:38:33 +00:00
Bill Wendling
449c57a0f9 Dead files. Functionality has been taken over by the Add*Writer functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34029 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-08 01:32:51 +00:00
Evan Cheng
bd8251a9a6 isLowRegister() expects input is a physical register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34013 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 21:44:33 +00:00
Evan Cheng
403e4a4725 Rename.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34011 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 21:24:09 +00:00
Evan Cheng
5ebd10e5ac If sp offset will be materialized in a register. Clear the offset field of str / ldr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34010 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 21:19:58 +00:00
Evan Cheng
8fdbe560a0 Get rid of references to iostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34009 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 21:18:32 +00:00
Evan Cheng
2ef02a220e New entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34000 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 09:22:15 +00:00
Evan Cheng
8bed6c968f In thumb mode, R3 is reserved, but it can be live in to the function. If
that is the case, whenever we use it as a scratch register, save it to R12
first and then restore it after the use.
This is a temporary and truly horrible workaround!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33999 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 09:17:36 +00:00
Evan Cheng
1f253d6e97 Update
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33998 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 08:37:57 +00:00
Evan Cheng
7142f8755a - If fp (r7) is used to reference stack objects, use [r, r] address mode.
- If there is a dynamic alloca, in the epilogue, restore the value of sp
  using r7 - offset.
- Other bug fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33997 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 08:37:31 +00:00
Evan Cheng
a01faf4a7a eliminateFrameIndex() is even more complicated if frame ptr is used instead of SP when there are dynamic alloca's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33975 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 02:44:23 +00:00
Evan Cheng
8e59ea998f Spill / restore should avoid modifying the condition register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33971 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 00:06:56 +00:00
Evan Cheng
8c1a73ad3f Select add FI, c correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33960 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-06 09:11:20 +00:00
Evan Cheng
40984d7449 foldMemoryOperand() cannot fold tMOVrr sp into load / store in thumb mode. tLDRspi / tSTRspi cannot target / store high registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33958 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-06 06:13:29 +00:00
Evan Cheng
88b633165a eliminateFrameIndex() bug when frame pointer is used as base register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33945 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-06 00:23:31 +00:00
Evan Cheng
ad0e465889 - Store val, [sp, c] must be selected to tSTRsp.
- If c does not fit in the offset field, materialize sp + c into a register
  using tADDhirr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33944 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-06 00:22:06 +00:00
Reid Spencer
d2a988caad Although targets are not required to support integers > 64bits, TargetData
must in order for backends that do want to support large integer types to be
able to function. Consequently, don't assert if the bitwidth > 64 bits
when computing the size and alignment. Instead, compute the size by rounding
up to the next even number of bytes for the size. Compute the alignment
as the same as the LongABIAlignment. These provide reasonable defaults
that the target can override.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33943 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 23:51:43 +00:00
Reid Spencer
ef9b9a7939 For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 20:47:22 +00:00
Chris Lattner
6241226b09 Fix a miscompilation in the addr mode code trying to implement X | C and
X + C to promote LEA formation.  We would incorrectly apply it in some cases
(test) and miss it in others.

This fixes CodeGen/X86/2007-02-04-OrAddrMode.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33884 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-04 20:18:17 +00:00
Evan Cheng
b38cba928e ARM callseq_end should have a input flag operand so it would be scheduled right after the call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33832 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-03 09:11:58 +00:00
Evan Cheng
fc4034259f Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33831 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-03 08:53:01 +00:00
Bill Wendling
736610c874 Moved the GetTargetRelocation method from PPCMachOWriter to here. It uses
non-Mach-O-specific information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33819 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-03 02:41:58 +00:00
Bill Wendling
e318391d4d Moved the GetTargetRelocation method to the PPCMachOWriterInfo object. The
PPCMachOWriter is now trivial.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-03 02:40:57 +00:00
Bill Wendling
d118cd27e3 Put destructor out-of-line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33817 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-03 02:40:10 +00:00
Evan Cheng
bd5d3dbdbe - Branch max. displacement calculation bug.
- Add debugging info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33811 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-03 02:08:34 +00:00
Lauro Ramos Venancio
4642ca6589 bugfix: SP isn't resetted when function has FP and there is no spills.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33800 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 23:08:40 +00:00
Evan Cheng
a21335dd76 Another thumb large stack offset codegen bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33795 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 21:08:39 +00:00
Evan Cheng
05cc424082 Use MBB.empty() instead of MBB.size() for speed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33789 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 19:09:19 +00:00
Evan Cheng
1dd6a606ad Watch out for empty BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33788 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 18:49:02 +00:00
Evan Cheng
f48ae3353e Ugh. Only meant to do this in thumb mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33780 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 08:58:48 +00:00
Chris Lattner
2d1222c060 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33778 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 04:36:46 +00:00
Reid Spencer
832254e1c2 Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 02:16:23 +00:00
Evan Cheng
9a2ef9509e Fix a bug in getARMCMP (which translate CondCode to ARM specific CC) when the RHS is a constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33775 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 01:53:26 +00:00
Evan Cheng
b0636156ef Thumb does not have clz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33773 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 23:34:03 +00:00
Lauro Ramos Venancio
c33f674ca3 Define PrivateGlobalPrefix for ARM Linux. (Fix CodeGen/ARM/large_stack.ll)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33763 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 21:43:53 +00:00
Evan Cheng
556f33c6e2 Pasto. Lots of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33762 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 20:44:52 +00:00
Lauro Ramos Venancio
6f46e59d2a Fix .thumb_func directive on linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33759 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 18:25:34 +00:00
Jim Laskey
b82313fdc2 Support for non-landing pad exception handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33755 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 16:31:34 +00:00
Evan Cheng
b43216ee4a - Off by one bugs in maximum displacement calculation / testing.
- In thumb mode, a new constpool island BB size should be 4 + 2 to
  compensate for the potential padding due to alignment requirement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33753 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 10:16:15 +00:00
Anton Korobeynikov
b25fe82671 Fixed uninitialized stuff inside LegalizeDAG. Fortunately, the only
affected part is codegen of "memove" inside x86 backend. This fixes
PR1144


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33752 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 08:39:52 +00:00
Evan Cheng
e0c2b6b9a8 .set pc relative displacement bug: label should be moved down one instruction
to just before the add r1, pc:

Before:
        .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
LPCRELL0:
        mov r1, #PCRELV0
        add r1, pc

Now:
        .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
        mov r1, #PCRELV0
LPCRELL0:
        add r1, pc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33744 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 03:04:49 +00:00
Evan Cheng
736cefff85 Add a note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33743 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 02:46:20 +00:00
Evan Cheng
9312313a56 Also set alignment of stack-based structs to 4 in thumb mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33741 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 02:18:36 +00:00
Evan Cheng
9d945f78e5 Special epilogue for vararg functions. We cannot do a pop to pc because
there follows a sp increment for the va register save region. Instead issue
a separate pop to another register, increment sp, and then return:
        pop {r4, r5, r6, r7}
        pop {r3}
        add sp, #3 * 4
        bx r3


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33739 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 01:49:46 +00:00
Evan Cheng
2021abe154 Pessmistically assume the .align 2 before the first constpool entry adds
two bytes padding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33734 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-01 01:09:47 +00:00