summaryrefslogtreecommitdiff
path: root/lib/CodeGen/PrologEpilogInserter.cpp
Commit message (Collapse)AuthorAge
...
* Move hasFP() and few related hooks to TargetFrameInfo.Anton Korobeynikov2010-11-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119740 91177308-0d34-0410-b5e6-96231b3b80d8
* First step of huge frame-related refactoring: move emit{Prologue,Epilogue} ↵Anton Korobeynikov2010-11-15
| | | | | | out of TargetRegisterInfo to TargetFrameInfo, which is definitely much better suitable place git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119097 91177308-0d34-0410-b5e6-96231b3b80d8
* Formatting.Jim Grosbach2010-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117453 91177308-0d34-0410-b5e6-96231b3b80d8
* Trivial grammar tweak.Jim Grosbach2010-10-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116710 91177308-0d34-0410-b5e6-96231b3b80d8
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-12
| | | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116334 91177308-0d34-0410-b5e6-96231b3b80d8
* Now with fewer extraneous semicolons!Owen Anderson2010-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify eliminateFrameIndex() interface back down now that PEI doesn't needJim Grosbach2010-08-26
| | | | | | 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
* Remove the now obsolete frame index virtual re-use algorithm from PEI. Pre-RAJim Grosbach2010-08-26
| | | | | | | | | virtual base registers handle this function, and more. A bit more cleanup to do on the interface to eliminateFrameIndex() after this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112237 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some statistics for PEI register scavengingJim Grosbach2010-08-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112084 91177308-0d34-0410-b5e6-96231b3b80d8
* Move enabling the local stack allocation pass into the target where it belongs.Jim Grosbach2010-08-24
| | | | | | | 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
* Remove the MFI storage of the local allocation block size. It's not needed.Jim Grosbach2010-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111847 91177308-0d34-0410-b5e6-96231b3b80d8
* Better handling of local offsets for downwards growing stacks. This correctsJim Grosbach2010-08-23
| | | | | | | relative offsets when there are offsets encoded in the instructions and simplifies final allocation in PEI. rdar://8277890 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111836 91177308-0d34-0410-b5e6-96231b3b80d8
* Update local stack block allocation to let PEI do the allocs if no additionalJim Grosbach2010-08-19
| | | | | | | | base registers were required. This will allow for slightly better packing of the locals when alignment padding is necessary after callee saved registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111508 91177308-0d34-0410-b5e6-96231b3b80d8
* Add materialization of virtual base registers for frame indices allocated intoJim Grosbach2010-08-17
| | | | | | | | | | | | | | | 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
* tidy up. remove unused local.Jim Grosbach2010-08-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111206 91177308-0d34-0410-b5e6-96231b3b80d8
* Better handle alignment requirements for local objects in pre-regalloc frameJim Grosbach2010-08-16
| | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111197 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a local stack object block allocation pass. This is still anJim Grosbach2010-08-14
| | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111059 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup comment wordingJim Grosbach2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110466 91177308-0d34-0410-b5e6-96231b3b80d8
* It's better to have the arrays, which would trigger the creation of stackBill Wendling2010-07-27
| | | | | | | | | | protectors, to be near the stack protectors on the stack. Accomplish this by tagging the stack object with a predicate that indicates that it would trigger this. In the prolog-epilog inserter, assign these objects to the stack after the stack protector but before the other objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109481 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up scavengeRegister() a bit to prefer available regs, which allowsJim Grosbach2010-07-08
| | | | | | | | the simplification of frame index register scavenging to not have to check for available registers directly and instead just let scavengeRegister() handle it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107880 91177308-0d34-0410-b5e6-96231b3b80d8
* When processing frame index virtual registers, consider all available registersJim Grosbach2010-07-08
| | | | | | | | | | (if there are any) and use the one which remains available for the longest rather than just using the first one. This should help enable better re-use of the loaded frame index values. rdar://7318760 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107847 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove isSS argument from CreateFixedObject. Fixed objects cannot be spill ↵Evan Cheng2010-07-03
| | | | | | slots so it's always false. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107550 91177308-0d34-0410-b5e6-96231b3b80d8
* Custom inserters (e.g., conditional moves in Thumb1 can introduceJim Grosbach2010-07-02
| | | | | | | | | | | | new basic blocks, and if used as a function argument, that can cause call frame setup / destroy pairs to be split across a basic block boundary. That prevents us from doing a simple assertion to check that the pairs match and alloc/ dealloc the same amount of space. Modify the assertion to only check the amount allocated when there are matching pairs in the same basic block. rdar://8022442 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107517 91177308-0d34-0410-b5e6-96231b3b80d8
* Propagate the AlignStack bit in InlineAsm's to the Dale Johannesen2010-07-02
| | | | | | | | | | | | | | | | | | | | | PrologEpilog code, and use it to determine whether the asm forces stack alignment or not. gcc consistently does not do this for GCC-style asms; Apple gcc inconsistently sometimes does it for asm blocks. There is no convenient place to put a bit in either the SDNode or the MachineInstr form, so I've added an extra operand to each; unlovely, but it does allow for expansion for more bits, should we need it. PR 5125. Some existing testcases are affected. The operand lists of the SDNode and MachineInstr forms are indexed with awesome mnemonics, like "2"; I may fix this someday, but not now. I'm not making it any worse. If anyone is inspired I think you can find all the right places from this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107506 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the TargetRegisterClass member from CalleeSavedInfoRafael Espindola2010-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105344 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove uses of getCalleeSavedRegClasses from outside theRafael Espindola2010-06-02
| | | | | | | backends and removes the virtual declaration. With that out of the way I should be able to cleanup one backend at a time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105321 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement @llvm.returnaddress. rdar://8015977.Evan Cheng2010-05-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104421 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename "HasCalls" in MachineFrameInfo to "AdjustsStack" to better describe whatBill Wendling2010-05-14
| | | | | | | | | | the variable actually tracks. N.B., several back-ends are using "HasCalls" as being synonymous for something that adjusts the stack. This isn't 100% correct and should be looked into. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103802 91177308-0d34-0410-b5e6-96231b3b80d8
* Add argument TargetRegisterInfo to loadRegFromStackSlot and storeRegToStackSlot.Evan Cheng2010-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103193 91177308-0d34-0410-b5e6-96231b3b80d8
* Reword a comment slightly.Eric Christopher2010-05-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102966 91177308-0d34-0410-b5e6-96231b3b80d8
* Make naked functions work on PPC.Dale Johannesen2010-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102657 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MachineFrameInfo variables to MFI, for consistency withDan Gohman2010-04-13
| | | | | | | the rest of CodeGen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101146 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the MMI pointer from MachineFrameInfo.Chris Lattner2010-04-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100415 91177308-0d34-0410-b5e6-96231b3b80d8
* Clear up the last (famous last words) frame index value reuse issues for Thumb1.Jim Grosbach2010-03-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98109 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the Value argument to eliminateFrameIndex to a type-tagged value. ThisJim Grosbach2010-03-09
| | | | | | | | | | is preparatory to having PEI's scavenged frame index value reuse logic properly distinguish types of frame values (e.g., whether the value is stack-pointer relative or frame-pointer relative). No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98086 91177308-0d34-0410-b5e6-96231b3b80d8
* Updated version of r96634 (which was reverted due to failing 176.gcc andJim Grosbach2010-02-22
| | | | | | | | 126.gcc nightly tests. These failures uncovered latent bugs that machine DCE could remove one half of a stack adjust down/up pair, causing PEI to assert. This update fixes that, and the tests now pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96822 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 96634. It causes assertion failures for 126.gcc and 176.gcc inBob Wilson2010-02-19
| | | | | | | the armv6 nightly tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96691 91177308-0d34-0410-b5e6-96231b3b80d8
* Radar 7636153. In the presence of large call frames, it's not sufficientJim Grosbach2010-02-19
| | | | | | | | | | | for ARM to just check if a function has a FP to determine if it's safe to simplify the stack adjustment pseudo ops prior to eliminating frame indices. Allow targets to override the default behavior and does so for ARM and Thumb2. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96634 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach MachineFrameInfo to track maximum alignment while stack objects are beingEvan Cheng2010-02-13
| | | | | | | | | | | created. This ensures it's updated at all time. It means targets which perform dynamic stack alignment would know whether it is required and whether frame pointer register cannot be made available register allocation. This is a fix for rdar://7625239. Sorry, I can't create a reasonably sized test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96069 91177308-0d34-0410-b5e6-96231b3b80d8
* move target-independent opcodes out of TargetInstrInfoChris Lattner2010-02-09
| | | | | | | | | | into TargetOpcodes.h. #include the new TargetOpcodes.h into MachineInstr. Add new inline accessors (like isPHI()) to MachineInstr, and start using them throughout the codebase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95687 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead store.Bill Wendling2009-12-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92187 91177308-0d34-0410-b5e6-96231b3b80d8
* Honour setHasCalls() set from isel.Anton Korobeynikov2009-12-11
| | | | | | | This is used in some weird cases like general dynamic TLS model. This fixes PR5723 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91144 91177308-0d34-0410-b5e6-96231b3b80d8
* improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner2009-12-03
| | | | | | | Patch by Howard Hinnant! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90365 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a bool flag to StackObjects telling whether they reference spillDavid Greene2009-11-12
| | | | | | | | | | | | | | 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.. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87022 91177308-0d34-0410-b5e6-96231b3b80d8
* When the function is doing dynamic stack realignment, the spill slot will beJim Grosbach2009-10-29
| | | | | | | | | indexed via the stack pointer, even if a frame pointer is present. Update the heuristic to place it nearest the stack pointer in that case, rather than nearest the frame pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85474 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup of frame index scavenging. Better code flow and more accuratelyJim Grosbach2009-10-21
| | | | | | handles T2 and ARM use cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84761 91177308-0d34-0410-b5e6-96231b3b80d8
* Better handle instructions that re-def a scratch registerJim Grosbach2009-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84657 91177308-0d34-0410-b5e6-96231b3b80d8
* Register re-use for scavenged frame indices must check for re-deginitionJim Grosbach2009-10-20
| | | | | | of the register in the instruction which kills the scavenged value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84641 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable post-pass frame index register scavenging for ARM and Thumb2Jim Grosbach2009-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84585 91177308-0d34-0410-b5e6-96231b3b80d8