summaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Re-enable usage of the ARM base pointer. r113394 fixed the known failures.Jim Grosbach2010-09-081-1/+1
| | | | | | Re-running some nightly testers w/ it enabled to verify. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113399 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix errant fall-throughs causing the base pointer to be used when the frameJim Grosbach2010-09-081-3/+3
| | | | | | pointer was intended. rdar://8401980 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113394 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more careful about when to do dynamic stack realignment. Since we have anJim Grosbach2010-09-081-2/+9
| | | | | | | option to disable base pointer usage, pay attention to it when deciding if we can realign (if no base pointer and VLAs, we can't). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113366 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing assertJim Grosbach2010-09-081-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113365 91177308-0d34-0410-b5e6-96231b3b80d8
* disable for the moment while tracking down a few Thumb2-O0 failure that lookJim Grosbach2010-09-081-1/+1
| | | | | | related. (attempt deux, complete w/ test update this time) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113333 91177308-0d34-0410-b5e6-96231b3b80d8
* woops. need to update a test along with this.Jim Grosbach2010-09-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113332 91177308-0d34-0410-b5e6-96231b3b80d8
* disable temporarily while sorting out a few test failures in Thumb2-O0 tests.Jim Grosbach2010-09-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113331 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r112883:Jim Grosbach2010-09-031-23/+76
| | | | | | | | | | | | | | | | | "For ARM stack frames that utilize variable sized objects and have either large local stack areas or require dynamic stack realignment, allocate a base register via which to access the local frame. This allows efficient access to frame indices not accessible via the FP (either due to being out of range or due to dynamic realignment) or the SP (due to variable sized object allocation). In particular, this greatly improves efficiency of access to spill slots in Thumb functions which contain VLAs." r112986 fixed a latent bug exposed by the above. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112989 91177308-0d34-0410-b5e6-96231b3b80d8
* Check the local frame alignment for determining whether dynamic stackJim Grosbach2010-09-031-1/+1
| | | | | | | | | | | alignment should be performed. Otherwise dynamic realignment may trigger when the register allocator has already used the frame pointer as a general purpose register. That is, we need to make sure that the list of reserved registers doesn't change after register allocation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112986 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "For ARM stack frames that utilize variable sized objects and have ↵Daniel Dunbar2010-09-031-76/+23
| | | | | | | | either", it is breaking oggenc with Clang for ARMv6. This reverts commit 8d6e29cfda270be483abf638850311670829ee65. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112962 91177308-0d34-0410-b5e6-96231b3b80d8
* For ARM stack frames that utilize variable sized objects and have eitherJim Grosbach2010-09-021-23/+76
| | | | | | | | | | | | | | | | | large local stack areas or require dynamic stack realignment, allocate a base register via which to access the local frame. This allows efficient access to frame indices not accessible via the FP (either due to being out of range or due to dynamic realignment) or the SP (due to variable sized object allocation). In particular, this greatly improves efficiency of access to spill slots in Thumb functions which contain VLAs. rdar://7352504 rdar://8374540 rdar://8355680 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112883 91177308-0d34-0410-b5e6-96231b3b80d8
* trailing whitespaceJim Grosbach2010-09-021-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112852 91177308-0d34-0410-b5e6-96231b3b80d8
* SP relative offsets need to be adjusted by the local allocation size whenJim Grosbach2010-08-311-0/+4
| | | | | | | determining if they're likely to be in range of the SP when resolving frame references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112624 91177308-0d34-0410-b5e6-96231b3b80d8
* this assert should just be a condition, since this function is just asking ifJim Grosbach2010-08-311-2/+5
| | | | | | the offset is legally encodable, not actually trying to do the encoding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112622 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify eliminateFrameIndex() interface back down now that PEI doesn't needJim Grosbach2010-08-261-15/+4
| | | | | | to try to re-use scavenged frame index reference registers. rdar://8277890 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112241 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy up a bit. no functional change.Jim Grosbach2010-08-261-30/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112228 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn off the scavenging based frame reg reuse briefly to measure whether it'sJim Grosbach2010-08-261-1/+1
| | | | | | | | still having a significant effect. It shouldn't be now that the pre-RA virtual base reg stuff is in. Assuming that's valididated by the nightly testers, we can simplify a lot of the PEI frame index code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112220 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable pre-RA virtual frame base register allocation. rdar://8277890Jim Grosbach2010-08-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112127 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't override the var from the enclosing scope.Jim Grosbach2010-08-251-2/+2
| | | | | | | When doing copy/paste/modify, it's apparently rather important to remember the 'modify' bit... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112075 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ARM heuristic for when to allocate a virtual base register for stackJim Grosbach2010-08-241-7/+45
| | | | | | access. rdar://8277890&7352504 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111968 91177308-0d34-0410-b5e6-96231b3b80d8
* Move enabling the local stack allocation pass into the target where it belongs.Jim Grosbach2010-08-241-1/+9
| | | | | | | For now it's still a command line option, but the interface to the generic code doesn't need to know that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111942 91177308-0d34-0410-b5e6-96231b3b80d8
* add ARM cmd line option to force always using virtual base regs when possible.Jim Grosbach2010-08-241-4/+16
| | | | | | | Intended to help ease reproducing problems by increasing base register usage after heuristics for only using the when needed are in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111930 91177308-0d34-0410-b5e6-96231b3b80d8
* Better handling of offsets on frame index references. rdar://8277890Jim Grosbach2010-08-191-6/+61
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111585 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Thumb1 support for virtual frame indices.Jim Grosbach2010-08-191-13/+15
| | | | | | | | rdar://8277890 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111533 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable ARM base register reuse to local stack slot allocation. Whenever a newJim Grosbach2010-08-181-0/+69
| | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111443 91177308-0d34-0410-b5e6-96231b3b80d8
* Add hook for re-using virtual base registers for local stack slot access.Jim Grosbach2010-08-181-0/+6
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111374 91177308-0d34-0410-b5e6-96231b3b80d8
* Add materialization of virtual base registers for frame indices allocated intoJim Grosbach2010-08-171-0/+43
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111315 91177308-0d34-0410-b5e6-96231b3b80d8
* Add hook to examine an instruction referencing a frame index to determineJim Grosbach2010-08-171-0/+41
| | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111262 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r110655 with fixes. Epilogue must restore sp from fp if the ↵Evan Cheng2010-08-101-40/+49
| | | | | | | | | function stack frame has a var-sized object. Also added a test case to check for the added benefit of this patch: it's optimizing away the unnecessary restore of sp from fp for some non-leaf functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110707 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r110655, "Fix ARM hasFP() semantics. It should return true whenever FPDaniel Dunbar2010-08-101-44/+40
| | | | | | register is", it breaks a couple test-suite tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110701 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ARM hasFP() semantics. It should return true whenever FP register isEvan Cheng2010-08-101-40/+44
| | | | | | | | | | | reserved, not available for general allocation. This eliminates all the extra checks for Darwin. This change also fixes the use of FP to access frame indices in leaf functions and cleaned up some confusing code in epilogue emission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110655 91177308-0d34-0410-b5e6-96231b3b80d8
* ARMBaseRegisterInfo::hasFP() has been broken for a while now. :-(Evan Cheng2010-08-091-1/+2
| | | | | | | | | | | This will always be false before PEI: (DisableFramePointerElim(MF) && MFI->adjustsStack()) Which means it's going to make r11 available as a general purpose register even if -disable-fp-elim is specified. It's working on Darwin only because r7 is always reserved. But it's obviously broken for other targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110614 91177308-0d34-0410-b5e6-96231b3b80d8
* For local variables in functions with a frame pointer, use FP as a baseJim Grosbach2010-08-051-18/+37
| | | | | | | | | | | register for local access when it's closer to the stack slot being refererenced than the stack pointer. Make sure to take into account any argument frame SP adjustments that are in affect at the time. rdar://8256090 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110366 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence a GCC warning about && and || without explicit parentheses. ThisChandler Carruth2010-08-051-3/+3
| | | | | | | | preserves the existing behavior, as it seems a concious choice to allow RS to be null and BigStack marked true. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110307 91177308-0d34-0410-b5e6-96231b3b80d8
* and back in. false alarm on the tests from another unrelated local change.Jim Grosbach2010-08-041-2/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110269 91177308-0d34-0410-b5e6-96231b3b80d8
* oops. revert for a moment to clean up tests first.Jim Grosbach2010-08-041-7/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110259 91177308-0d34-0410-b5e6-96231b3b80d8
* Reserve a stack slot if the function adjusts the stack but doesn'tJim Grosbach2010-08-041-2/+7
| | | | | | | | | | | simplify the call frame pseudo instructions. In that situation, the calculations for estimating the stack size will be way off, leading to not having an emergency spill slot when we need one. It should be possible to be more precise about tracking the adjustment values, but not really necessary for correctness. Upcoming cleanups for PEI in general will render that moot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110258 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for getting & setting the FPSCR application register on ARM when ↵Nate Begeman2010-08-031-0/+1
| | | | | | | | | | VFP is enabled. Add support for using the FPSCR in conjunction with the vcvtr instruction, for controlling fp to int rounding. Add support for the FLT_ROUNDS_ node now that the FPSCR is exposed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110152 91177308-0d34-0410-b5e6-96231b3b80d8
* switch a private implementation of GetFunctionSizeInBytes.Chris Lattner2010-07-221-1/+14
| | | | | | | | | | This is probably not the best way to implement "Force LR to be spilled if the Thumb function size is > 2048." do this, it should use the branch shortening infrastructure, but I'm just preserving functionality here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109165 91177308-0d34-0410-b5e6-96231b3b80d8
* Constify some arguments.Eric Christopher2010-07-201-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108812 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary check that was subsumed into canRealignStack.Eric Christopher2010-07-171-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108588 91177308-0d34-0410-b5e6-96231b3b80d8
* Make more explicit and add some currently disabled error messages forEric Christopher2010-07-171-4/+18
| | | | | | | | | | stack realignment on ARM. Also check for function attributes as we do on X86 as well as make explicit that we're checking can as well as needs in this function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108582 91177308-0d34-0410-b5e6-96231b3b80d8
* Add parentheses yet again to satisfy GCC's warnings.Chandler Carruth2010-07-101-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108043 91177308-0d34-0410-b5e6-96231b3b80d8
* In the presence of variable sized objects, allocate an emergency spill slot.Jim Grosbach2010-07-091-3/+10
| | | | | | rdar://8131327 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108008 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes to ARM tail calls, mostly cosmetic.Dale Johannesen2010-07-081-1/+2
| | | | | | | | | | | Add explicit testcases for tail calls within the same module. Duplicate some code to humor those who think .w doesn't apply on ARM. Leave this disabled on Thumb1, and add some comments explaining why it's hard and won't gain much. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107851 91177308-0d34-0410-b5e6-96231b3b80d8
* When using ADDri to get the address of a stack object, 255 is a conservativeJakob Stoklund Olesen2010-06-181-0/+9
| | | | | | | limit on the offset that can be materialized without using the register scavenger. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106312 91177308-0d34-0410-b5e6-96231b3b80d8
* An attempt to fix the problem Anton reported withDale Johannesen2010-06-181-1/+2
| | | | | | | | | ARM tail calls. Don't know if it works, but it doesn't break Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106309 91177308-0d34-0410-b5e6-96231b3b80d8
* Next round of tail call changes. Register used in a tailDale Johannesen2010-06-151-3/+5
| | | | | | | | | | call must not be callee-saved; following x86, add a new regclass to represent this. Also fixes a couple of bugs. Still disabled by default; Thumb doesn't work yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106053 91177308-0d34-0410-b5e6-96231b3b80d8
* Early implementation of tail call for ARM.Dale Johannesen2010-06-031-0/+30
| | | | | | | | | | | A temporary flag -arm-tail-calls defaults to off, so there is no functional change by default. Intrepid users may try this; simple cases work but there are bugs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105413 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename canCombinedSubRegIndex method to something more grammatically correctBob Wilson2010-06-021-1/+1
| | | | | | | and tidy up the comment describing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105339 91177308-0d34-0410-b5e6-96231b3b80d8