summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* During local stack slot allocation, the materializeFrameBaseRegister functionBill Wendling2010-12-171-7/+13
| | | | | | | | | | | | | | | may be called. If the entry block is empty, the insertion point iterator will be the "end()" value. Calling ->getParent() on it (among others) causes problems. Modify materializeFrameBaseRegister to take the machine basic block and insert the frame base register at the beginning of that block. (It's very similar to what the code does all ready. The only difference is that it will always insert at the beginning of the entry block instead of after a previous materialization of the frame base register. I doubt that that matters here.) <rdar://problem/8782198> llvm-svn: 122104
* When using multiple instructions to reference a frame index, make sure toJim Grosbach2010-12-091-0/+5
| | | | | | update the opcode when necessary as well as the source register. llvm-svn: 121346
* Move more PEI-related hooks to TFIAnton Korobeynikov2010-11-271-322/+0
| | | | llvm-svn: 120229
* Fix epilogue codegen to avoid leaving the stack pointer in an invalidEvan Cheng2010-11-221-3/+4
| | | | | | | | | | | | | | | | | state. Previously Thumb2 would restore sp from fp like this: mov sp, r7 sub, sp, #4 If an interrupt is taken after the 'mov' but before the 'sub', callee-saved registers might be clobbered by the interrupt handler. Instead, try restoring directly from sp: add sp, #4 Or, if necessary (with VLA, etc.) use a scratch register to compute sp and then restore it: sub.w r4, r7, #8 mov sp, r7 rdar://8465407 llvm-svn: 119977
* Move some more hooks to TargetFrameInfoAnton Korobeynikov2010-11-201-92/+4
| | | | llvm-svn: 119904
* Move hasFP() and few related hooks to TargetFrameInfo.Anton Korobeynikov2010-11-181-58/+25
| | | | llvm-svn: 119740
* Code clean up.Evan Cheng2010-11-181-6/+2
| | | | llvm-svn: 119604
* First step of huge frame-related refactoring: move emit{Prologue,Epilogue} ↵Anton Korobeynikov2010-11-151-331/+0
| | | | | | out of TargetRegisterInfo to TargetFrameInfo, which is definitely much better suitable place llvm-svn: 119097
* Revert this temporarily.Eric Christopher2010-11-111-25/+17
| | | | llvm-svn: 118827
* Change the prologue and epilogue to use push/pop for the low ARM registers.Eric Christopher2010-11-111-17/+25
| | | | llvm-svn: 118823
* Revert r114340 (improvements in Darwin function prologue/epilogue), as it brokeJim Grosbach2010-11-021-23/+89
| | | | | | assumptions about stack layout. Specifically, LR must be saved next to FP. llvm-svn: 118026
* Refactor ARM STR/STRB instruction patterns into STR{B}i12 and STR{B}rs, likeJim Grosbach2010-10-271-2/+2
| | | | | | | | the LDR instructions have. This makes the literal/register forms of the instructions explicit and allows us to assign scheduling itineraries appropriately. rdar://8477752 llvm-svn: 117505
* Split ARM::LDRB into LDRBi12 and LDRBrs. Adjust accordingly. Continuing onJim Grosbach2010-10-271-1/+1
| | | | | | rdar://8477752. llvm-svn: 117419
* First part of refactoring ARM addrmode2 (load/store) instructions to be moreJim Grosbach2010-10-261-4/+6
| | | | | | | | explicit about the operands. Split out the different variants into separate instructions. This gives us the ability to, among other things, assign different scheduling itineraries to the variants. rdar://8477752. llvm-svn: 117409
* Nuke extraneous comment. It's applicable elsewhere, but not in this func.Jim Grosbach2010-10-261-2/+0
| | | | llvm-svn: 117387
* Nuke a commented out bit that got missed a while back.Jim Grosbach2010-10-191-1/+1
| | | | llvm-svn: 116883
* For Thumb2, try to use frame pointer references for stack slots even when aJim Grosbach2010-10-181-2/+10
| | | | | | base register is available. rdar://8525298 llvm-svn: 116729
* ARM addrmode4 instructions (ldm, stm and friends) can't encode an immediateJim Grosbach2010-10-181-1/+2
| | | | | | | | offset for stack references. Make sure we take that into account when deciding whether to reserver an emergency spill slot for the register scavenger. rdar://8559625 llvm-svn: 116714
* Grammar tweak.Jim Grosbach2010-10-181-1/+1
| | | | llvm-svn: 116712
* Simplify ARM callee-saved register handling by removing the distinctionJim Grosbach2010-09-201-89/+23
| | | | | | | | | | | | | | | | | | | between the high and low registers for prologue/epilogue code. This was a Darwin-only thing that wasn't providing a realistic benefit anymore. Combining the save areas simplifies the compiler code and results in better ARM/Thumb2 codegen. For example, previously we would generate code like: push {r4, r5, r6, r7, lr} add r7, sp, #12 stmdb sp!, {r8, r10, r11} With this change, we combine the register saves and generate: push {r4, r5, r6, r7, r8, r10, r11, lr} add r7, sp, #12 rdar://8445635 llvm-svn: 114340
* move getRegisterNumbering() to out of ARMBaseRegisterInfo into the helperJim Grosbach2010-09-151-40/+0
| | | | | | | | | functions in ARMBaseInfo.h so it can be used in the MC library as well. For anything bigger than this, we may want a means to have a small support library for shared helper functions like this. Cross that bridge when we come to it. llvm-svn: 114016
* simplify getRegisterNumbering(). Remove the unused isSPVFP argument andJim Grosbach2010-09-151-86/+35
| | | | | | merge the common cases. llvm-svn: 114013
* 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. llvm-svn: 113399
* Fix errant fall-throughs causing the base pointer to be used when the frameJim Grosbach2010-09-081-3/+3
| | | | | | pointer was intended. rdar://8401980 llvm-svn: 113394
* 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). llvm-svn: 113366
* Add missing assertJim Grosbach2010-09-081-1/+4
| | | | llvm-svn: 113365
* 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) llvm-svn: 113333
* woops. need to update a test along with this.Jim Grosbach2010-09-081-1/+1
| | | | llvm-svn: 113332
* disable temporarily while sorting out a few test failures in Thumb2-O0 tests.Jim Grosbach2010-09-081-1/+1
| | | | llvm-svn: 113331
* 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. llvm-svn: 112989
* 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. llvm-svn: 112986
* 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. llvm-svn: 112962
* 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 llvm-svn: 112883
* trailing whitespaceJim Grosbach2010-09-021-6/+6
| | | | llvm-svn: 112852
* 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. llvm-svn: 112624
* 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. llvm-svn: 112622
* 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 llvm-svn: 112241
* tidy up a bit. no functional change.Jim Grosbach2010-08-261-30/+9
| | | | llvm-svn: 112228
* 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. llvm-svn: 112220
* Enable pre-RA virtual frame base register allocation. rdar://8277890Jim Grosbach2010-08-261-1/+1
| | | | llvm-svn: 112127
* 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... llvm-svn: 112075
* Add ARM heuristic for when to allocate a virtual base register for stackJim Grosbach2010-08-241-7/+45
| | | | | | access. rdar://8277890&7352504 llvm-svn: 111968
* 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. llvm-svn: 111942
* 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. llvm-svn: 111930
* Better handling of offsets on frame index references. rdar://8277890Jim Grosbach2010-08-191-6/+61
| | | | llvm-svn: 111585
* Add Thumb1 support for virtual frame indices.Jim Grosbach2010-08-191-13/+15
| | | | | | rdar://8277890 llvm-svn: 111533
* 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 llvm-svn: 111443
* 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 llvm-svn: 111374
* 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. llvm-svn: 111315
* 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 llvm-svn: 111262
OpenPOWER on IntegriCloud