1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

227 Commits

Author SHA1 Message Date
Dale Johannesen
544968d665 rewrite of constant islands
llvm-svn: 34523
2007-02-23 05:02:36 +00:00
Evan Cheng
af3b119b29 These vectors are frequently large. Use std::vector instead.
llvm-svn: 34109
2007-02-09 23:59:14 +00:00
Evan Cheng
5e8eb0c198 Add reference counting to constantpool entries. Delete the unused ones.
llvm-svn: 34105
2007-02-09 20:54:44 +00:00
Evan Cheng
b4c6dfa3e7 - Branch max. displacement calculation bug.
- Add debugging info.

llvm-svn: 33811
2007-02-03 02:08:34 +00:00
Evan Cheng
496c67ee3e Use MBB.empty() instead of MBB.size() for speed.
llvm-svn: 33789
2007-02-02 19:09:19 +00:00
Evan Cheng
6a428320d6 Watch out for empty BB.
llvm-svn: 33788
2007-02-02 18:49:02 +00:00
Evan Cheng
3d9b702988 Pasto. Lots of it.
llvm-svn: 33762
2007-02-01 20:44:52 +00:00
Evan Cheng
88b703eec4 - 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.

llvm-svn: 33753
2007-02-01 10:16:15 +00:00
Evan Cheng
9f87fca49c Pessmistically assume the .align 2 before the first constpool entry adds
two bytes padding.

llvm-svn: 33734
2007-02-01 01:09:47 +00:00
Evan Cheng
765de99fac Handle an interesting corner case: the constpool_entry being reference is two
instructions away, i.e. its address is equal to PC.
        %r0 = tLDRpci <cp#0>
        bx
        CONSTPOOL_ENTRY 0 <cp#0>, 4

llvm-svn: 33728
2007-01-31 23:35:18 +00:00
Evan Cheng
1df8529721 When determining whether a pc relative branch / load displacement fits in the
instruction field, adjust it for PC value (4 for thumb, 8 for arm).

llvm-svn: 33711
2007-01-31 19:57:44 +00:00
Evan Cheng
f6e0e6cada Some comments.
llvm-svn: 33707
2007-01-31 18:29:27 +00:00
Evan Cheng
16edf4f9bf ConstPool island bug: watch out for cases where UserMI is the last MI of the BB.
llvm-svn: 33706
2007-01-31 18:19:07 +00:00
Evan Cheng
0ee9a27976 - Added Thumb constpool island support.
- Islands are inserted right after the user MI since thumb LDR cannot encode
  negative offset.

llvm-svn: 33690
2007-01-31 02:22:22 +00:00
Evan Cheng
91ad06dd75 - In thumb mode, if size of MachineFunction is >= 2048, force LR to be
spilled (if it is not already).
- If LR is spilled, use BL to implement far jumps. LR is not used as a GPR
  in thumb mode so it can be clobbered if it is properly spilled / restored
  in prologue / epilogue.
- If LR is force spilled but no far jump has been emitted, try undo'ing the
  spill by:
  push lr -> delete
  pop pc -> bx lr

llvm-svn: 33650
2007-01-30 01:18:38 +00:00
Evan Cheng
171943e26e Factor GetInstSize() out of constpool island pass.
llvm-svn: 33644
2007-01-29 23:45:17 +00:00
Evan Cheng
4618d3131c Thumb jumptable support.
llvm-svn: 33568
2007-01-27 02:29:45 +00:00
Evan Cheng
2b4f267d57 Conditional branch being fixed up is not the last MI in the BB, there is a
unconditional branch following it. Simply invert the condition and swap
destinations if the conditional branch can reach the destination of the
unconditional branch:
beq L1
b   L2
=>
bne L2
b   L1

llvm-svn: 33548
2007-01-26 20:38:26 +00:00
Jim Laskey
23ed7d2625 Make LABEL a builtin opcode.
llvm-svn: 33537
2007-01-26 14:34:52 +00:00
Evan Cheng
c81bceda82 SplitBlockBeforeInstr() insert a unconditional branch to the next BB. This
is unnecessary when we are fixing up a conditional branch since we will be
adding a unconditional branch to the destination of the original branch.

llvm-svn: 33517
2007-01-26 02:02:39 +00:00
Evan Cheng
c5a454b111 Need to scan the function for branches even if there aren't any constants.
llvm-svn: 33515
2007-01-26 01:04:44 +00:00
Evan Cheng
6a46a78547 Forgot to update this.
llvm-svn: 33512
2007-01-25 23:31:04 +00:00
Evan Cheng
a229bc12be Add comment, fix typo, reduce memory usage, etc.
llvm-svn: 33510
2007-01-25 23:18:59 +00:00
Evan Cheng
7dccb7be86 Doh. Skip JT branches.
llvm-svn: 33501
2007-01-25 19:43:52 +00:00
Evan Cheng
d7c809c7be Added (preliminary) branch shortening capability to constantpool island pass.
llvm-svn: 33497
2007-01-25 03:12:46 +00:00
Evan Cheng
c6db78ab84 Use PC relative ldr to load from a constantpool in Thumb mode.
llvm-svn: 33484
2007-01-24 08:53:17 +00:00
Evan Cheng
c6e1d453d3 ARM backend contribution from Apple.
llvm-svn: 33353
2007-01-19 07:51:42 +00:00