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

93 Commits

Author SHA1 Message Date
Jim Grosbach
23b76845a7 As of r79039, we still try to eliminate the frame pointer on leaf functions,
even when -disable-fp-elim is specified.

llvm-svn: 95161
2010-02-02 23:56:14 +00:00
Chris Lattner
278075333e constify a method argument.
llvm-svn: 94612
2010-01-26 23:15:09 +00:00
Jim Grosbach
034f69e0aa For aligned load/store instructions, it's only required to know whether a
function can support dynamic stack realignment. That's a much easier question
to answer at instruction selection stage than whether the function actually
will have dynamic alignment prologue. This allows the removal of the
stack alignment heuristic pass, and improves code quality for cases where
the heuristic would result in dynamic alignment code being generated when
it was not strictly necessary.

llvm-svn: 93885
2010-01-19 18:31:11 +00:00
Jim Grosbach
40aafaec86 80 column violations
llvm-svn: 92876
2010-01-06 23:54:42 +00:00
Jim Grosbach
76768e7216 Addressing mode 6 (load/store) instructions can't encode an immediate offset
for stack references.

llvm-svn: 92871
2010-01-06 23:45:18 +00:00
Jakob Stoklund Olesen
affe25dbaf Use proper move instructions. Make the verifier happy.
llvm-svn: 91914
2009-12-22 18:49:55 +00:00
Anton Korobeynikov
eee906f4f0 Dynamic stack realignment use of sp register as source/dest register
in "bic sp, sp, #15" leads to unpredicatble behaviour in Thumb2 mode.
Emit the following code instead:
mov r4, sp
bic r4, r4, #15
mov sp, r4

llvm-svn: 90724
2009-12-06 22:39:50 +00:00
Jim Grosbach
0e1230b23b Factor the stack alignment calculations out into a target independent pass.
No functionality change.

llvm-svn: 90336
2009-12-02 19:30:24 +00:00
Jim Grosbach
928cb87167 Move default FrameReg val to getFrameIndexReference(). Otherwise, debug info can get bogus values.
llvm-svn: 89618
2009-11-22 20:05:32 +00:00
Jim Grosbach
33f06ed72e Generate more correct debug info for frame indices.
llvm-svn: 89576
2009-11-22 02:32:29 +00:00
Jim Grosbach
99c5b49c61 Revert 89562. We're being sneakier than I was giving us credit for, and this
isn't necessary.

llvm-svn: 89568
2009-11-21 23:34:09 +00:00
Jim Grosbach
d4603a5c4e Darwin requires a frame pointer for all non-leaf functions to support correct
backtraces.

llvm-svn: 89562
2009-11-21 21:40:08 +00:00
Jim Grosbach
2c6e8c5ccc Make the pass class name more explicit.
llvm-svn: 88964
2009-11-16 21:13:22 +00:00
Jim Grosbach
736ee00309 make pass name a bit more clear
llvm-svn: 88961
2009-11-16 21:03:58 +00:00
Jim Grosbach
1aa571da3c Detect need for autoalignment of the stack earlier to catch spills more
conservatively. eliminateFrameIndex() machinery adjust to handle addr mode
6 (vld1/vst1) used for spills. Fix tests to expect aligned Q-reg spilling

llvm-svn: 88874
2009-11-15 21:45:34 +00:00
David Greene
58e7c6145b Add a bool flag to StackObjects telling whether they reference spill
slots.  The AsmPrinter will use this information to determine whether to
print a spill/reload comment.

Remove default argument values.  It's too easy to pass a wrong argument
value when multiple arguments have default values.  Make everything
explicit to trap bugs early.

Update all targets to adhere to the new interfaces..

llvm-svn: 87022
2009-11-12 20:49:22 +00:00
Jim Grosbach
ed9f847274 Now that the default is 'enabled,' a separate command line option for ARM is
not necessary.

llvm-svn: 86621
2009-11-09 23:11:45 +00:00
Jim Grosbach
b934f9ccd4 Enable dynamic stack realignment by default.
llvm-svn: 86604
2009-11-09 22:32:40 +00:00
Jim Grosbach
3e2968ee4b Set dynamic stack realignment to real values.
llvm-svn: 86602
2009-11-09 22:32:03 +00:00
Jim Grosbach
ea6c9c17f5 Use Unified Assembly Syntax for the ARM backend.
llvm-svn: 86494
2009-11-09 00:11:35 +00:00
Jim Grosbach
53aa92f766 Use aligned load/store instructions for spilling Q registers when we know the stack slot is 128 bit aligned
llvm-svn: 86425
2009-11-08 00:27:19 +00:00
Jim Grosbach
ef37391033 Grammar.
llvm-svn: 86068
2009-11-04 23:20:40 +00:00
Jim Grosbach
2867641b64 Now that the memory leak from McCat/08-main has been fixed (86056), re-enable
aggressive testing of dynamic stack alignment.
Note that this is off by default, and enabled for LLCBETA nightly results.

llvm-svn: 86064
2009-11-04 23:11:07 +00:00
Jim Grosbach
c0cabc9119 If a function has no stack frame at all, dynamic realignment isn't necessary.
llvm-svn: 86057
2009-11-04 22:41:51 +00:00
Jim Grosbach
c8a01556f4 dynamic stack realignment necessitates scanning the floating point callee-
saved instructions even if no stack adjustment for those saves is needed.

llvm-svn: 86056
2009-11-04 22:41:00 +00:00
Evan Cheng
ed22395c61 Fix PR5367. QPR_8 is the super regclass of DPR_8 and SPR_8.
llvm-svn: 85871
2009-11-03 05:52:54 +00:00
Anton Korobeynikov
48b30c79be Revert r85049, it is causing PR5367
llvm-svn: 85847
2009-11-03 00:24:48 +00:00
Evan Cheng
4a0d47f209 Make use of imm12 version of Thumb2 ldr / str instructions more aggressively.
llvm-svn: 85743
2009-11-01 21:12:51 +00:00
Jim Grosbach
95e1ff2dba Dial back the realignment a bit.
llvm-svn: 85546
2009-10-30 00:08:40 +00:00
Jim Grosbach
071b4ec891 To get more thorough testing from llc-beta nightly runs, do dynamic stack
realignment regardless of whether it's strictly necessary.

llvm-svn: 85476
2009-10-29 02:41:21 +00:00
Jim Grosbach
e42dc83a9f Cleanup now that frame index scavenging via post-pass is working for ARM and Thumb2.
llvm-svn: 85406
2009-10-28 17:33:28 +00:00
Jim Grosbach
7c0566a5cc Enable virtual register based frame index scavenging by default for ARM & T2.
llvm-svn: 85335
2009-10-27 22:52:29 +00:00
Jim Grosbach
a6946f0f50 Infrastructure for dynamic stack realignment on ARM. For now, this is off by
default behind a command line option. This will enable better performance for
vectors on NEON enabled processors.

llvm-svn: 85333
2009-10-27 22:45:39 +00:00
Evan Cheng
d748ce45ab Add ARM getMatchingSuperRegClass to handle S / D / Q cross regclass coalescing.
llvm-svn: 85049
2009-10-25 07:53:28 +00:00
Jim Grosbach
f79f9afb91 Missing piece of the ARM frame index post-scavenging conditionalization
llvm-svn: 84798
2009-10-21 23:40:56 +00:00
Jim Grosbach
363a67d9c5 Conditionalize ARM/T2 frame index post-scavenging while working out fixes
for a few bugs.

llvm-svn: 84791
2009-10-21 22:59:24 +00:00
Jim Grosbach
8a182902ef Disable by default while debugging
llvm-svn: 84669
2009-10-20 20:31:31 +00:00
Jim Grosbach
5f9188c873 add cmd line opt to disable frame index reuse for ARM and T2. debug aid.
llvm-svn: 84664
2009-10-20 20:19:50 +00:00
Jim Grosbach
c4acd85bfd Enable post-pass frame index register scavenging for ARM and Thumb2
llvm-svn: 84585
2009-10-20 01:26:58 +00:00
Jim Grosbach
2fb5eb1264 Enable allocation of R3 in Thumb1
llvm-svn: 84563
2009-10-19 22:57:03 +00:00
Jim Grosbach
61c5ce1bde Add register-reuse to frame-index register scavenging. When a target uses
a virtual register to eliminate a frame index, it can return that register
and the constant stored there to PEI to track. When scavenging to allocate
for those registers, PEI then tracks the last-used register and value, and
if it is still available and matches the value for the next index, reuses
the existing value rather and removes the re-materialization instructions.
Fancier tracking and adjustment of scavenger allocations to keep more
values live for longer is possible, but not yet implemented and would likely
be better done via a different, less special-purpose, approach to the
problem.

eliminateFrameIndex() is modified so the target implementations can return
the registers they wish to be tracked for reuse.

ARM Thumb1 implements and utilizes the new mechanism. All other targets are
simply modified to adjust for the changed eliminateFrameIndex() prototype.

llvm-svn: 83467
2009-10-07 17:12:56 +00:00
Jim Grosbach
d6da133b85 In Thumb1, the register scavenger is not always able to use an emergency
spill slot. When frame references are via the frame pointer, they will be
negative, but Thumb1 load/store instructions only allow positive immediate
offsets. Instead, Thumb1 will spill to R12.

llvm-svn: 83336
2009-10-05 22:30:23 +00:00
Jim Grosbach
2c211c7bfe Clarify comment phrasing.
llvm-svn: 83148
2009-09-30 15:23:38 +00:00
Jim Grosbach
9655673c95 When checking whether we need to reserve a register for the scavenger,
the size of the saved frame pointer needs to be taken into account.

llvm-svn: 83136
2009-09-30 01:43:29 +00:00
Jim Grosbach
278d0d5b3d minor cleanup and add clarifying comment
llvm-svn: 83117
2009-09-29 23:17:20 +00:00
Jim Grosbach
9cb82ce219 Adjust processFunctionBeforeCalleeSavedScan() to correctly reserve a stack
slot for the register scavenger when compiling Thumb1 functions.

llvm-svn: 83023
2009-09-28 22:08:06 +00:00
Bob Wilson
c5784025af Add some comments to clarify things that I discovered this week.
llvm-svn: 82773
2009-09-25 16:34:46 +00:00
Jim Grosbach
3d527ff081 Start of revamping the register scavenging in PEI. ARM Thumb1 is the driving
interest for this, as it currently reserves a register rather than using
the scavenger for matierializing constants as needed.

Instead of scavenging registers on the fly while eliminating frame indices,
new virtual registers are created, and then a scavenged collectively in a
post-pass over the function. This isolates the bits that need to interact
with the scavenger, and sets the stage for more intelligent use, and reuse,
of scavenged registers.

For the time being, this is disabled by default. Once the bugs are worked out,
the current scavenging calls in replaceFrameIndices() will be removed and
the post-pass scavenging will be the default. Until then,
-enable-frame-index-scavenging enables the new code. Currently, only the
Thumb1 back end is set up to use it.

llvm-svn: 82734
2009-09-24 23:52:18 +00:00
Bob Wilson
1b311a6a9b Fix a typo in an assertion message.
llvm-svn: 82284
2009-09-18 21:42:44 +00:00
Jim Grosbach
932453f233 Revert array initialization regclass change so that the initialization stays static, not runtime.
llvm-svn: 81560
2009-09-11 20:13:17 +00:00