Commit Graph

15 Commits

Author SHA1 Message Date
Jim Grosbach 7648a21152 Downwards growing stack allocation order reverses relative offsets
llvm-svn: 111673
2010-08-20 20:25:31 +00:00
Jim Grosbach 7110941d68 Add more dbg output
llvm-svn: 111670
2010-08-20 19:04:43 +00:00
Jim Grosbach 0600691fe6 properly check for whether base regs were inserted
llvm-svn: 111646
2010-08-20 16:48:30 +00:00
Jim Grosbach 56e56323c8 Better handling of offsets on frame index references. rdar://8277890
llvm-svn: 111585
2010-08-19 23:52:25 +00:00
Jim Grosbach 743d7c80e4 Update local stack block allocation to let PEI do the allocs if no additional
base registers were required. This will allow for slightly better packing
of the locals when alignment padding is necessary after callee saved registers.

llvm-svn: 111508
2010-08-19 02:47:08 +00:00
Jim Grosbach 3ac059369b Add a newline to debug output
llvm-svn: 111453
2010-08-18 23:14:02 +00:00
Jim Grosbach dbfc2ce95d Enable ARM base register reuse to local stack slot allocation. Whenever a new
frame index reference to an object in the local block is seen, check if
it's near enough to any previously allocaated base register to re-use.

rdar://8277890

llvm-svn: 111443
2010-08-18 22:44:49 +00:00
Jim Grosbach e0e9b3013f Add hook for re-using virtual base registers for local stack slot access.
Nothing fancy, just ask the target if any currently available base reg
is in range for the instruction under consideration and use the first one
that is. Placeholder ARM implementation simply returns false for now.

ongoing saga of rdar://8277890

llvm-svn: 111374
2010-08-18 17:57:37 +00:00
Jim Grosbach 3cf08661f4 Add materialization of virtual base registers for frame indices allocated into
the local block. Resolve references to those indices to a new base register.
For simplification and testing purposes, a new virtual base register is
allocated for each frame index being resolved. The result is truly horrible,
but correct, code that's good for exercising the new code paths.

Next up is adding thumb1 support, which should be very simple. Following that
will be adding base register re-use and implementing a reasonable ARM
heuristic for when a virtual base register should be generated at all.

llvm-svn: 111315
2010-08-17 22:41:55 +00:00
Jim Grosbach 1a58ce7646 silence warning
llvm-svn: 111274
2010-08-17 20:21:30 +00:00
Jim Grosbach c252ee2375 Add hook to examine an instruction referencing a frame index to determine
whether to allocate a virtual frame base register to resolve the frame
index reference in it. Implement a simple version for ARM to aid debugging.

In LocalStackSlotAllocation, scan the function for frame index references
to local frame indices and ask the target whether to allocate virtual
frame base registers for any it encounters. Purely infrastructural for
debug output. Next step is to actually allocate base registers, then add
intelligent re-use of them.

rdar://8277890

llvm-svn: 111262
2010-08-17 18:13:53 +00:00
Jim Grosbach a7c562d664 tidy up. remove unused local.
llvm-svn: 111206
2010-08-16 23:26:09 +00:00
Jim Grosbach 36d5ec383e Better handle alignment requirements for local objects in pre-regalloc frame
mapping. Have the local block track its alignment requirement, and then
apply that when the block itself is allocated. Previously, offsets could
get adjusted in PEI to be different, relative to one another, than the
block allocation thought they would be, which defeats the point of doing
the allocation this way. Continuing rdar://8277890

llvm-svn: 111197
2010-08-16 22:30:41 +00:00
Jim Grosbach 8be0196afe track local frame size in MFI, not local to the pass, since PEI needs it.
llvm-svn: 111164
2010-08-16 18:06:15 +00:00
Jim Grosbach a030fa5297 Add a local stack object block allocation pass. This is still an
experimental pass that allocates locals relative to one another before
register allocation and then assigns them to actual stack slots as a block
later in PEI. This will eventually allow targets with limited index offset
range to allocate additional base registers (not just FP and SP) to
more efficiently reference locals, as well as handle situations where
locals cannot be referenced via SP or FP at all (dynamic stack realignment
together with variable sized objects, for example). It's currently
incomplete and almost certainly buggy. Work in progress.

Disabled by default and gated via the -enable-local-stack-alloc command
line option.

rdar://8277890

llvm-svn: 111059
2010-08-14 00:15:52 +00:00