summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PrologEpilogInserter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Update local stack block allocation to let PEI do the allocs if no additionalJim Grosbach2010-08-191-3/+5
| | | | | | | 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
* Add materialization of virtual base registers for frame indices allocated intoJim Grosbach2010-08-171-1/+1
| | | | | | | | | | | | | 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
* tidy up. remove unused local.Jim Grosbach2010-08-161-0/+2
| | | | llvm-svn: 111206
* Better handle alignment requirements for local objects in pre-regalloc frameJim Grosbach2010-08-161-7/+13
| | | | | | | | | | 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
* Add a local stack object block allocation pass. This is still anJim Grosbach2010-08-141-0/+32
| | | | | | | | | | | | | | | | | | 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
* Cleanup comment wordingJim Grosbach2010-08-061-3/+3
| | | | llvm-svn: 110466
* It's better to have the arrays, which would trigger the creation of stackBill Wendling2010-07-271-1/+23
| | | | | | | | | 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. llvm-svn: 109481
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-2/+2
| | | | llvm-svn: 109045
* Clean up scavengeRegister() a bit to prefer available regs, which allowsJim Grosbach2010-07-081-15/+1
| | | | | | | | the simplification of frame index register scavenging to not have to check for available registers directly and instead just let scavengeRegister() handle it. llvm-svn: 107880
* When processing frame index virtual registers, consider all available registersJim Grosbach2010-07-081-2/+12
| | | | | | | | (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 llvm-svn: 107847
* Remove isSS argument from CreateFixedObject. Fixed objects cannot be spill ↵Evan Cheng2010-07-031-2/+1
| | | | | | slots so it's always false. llvm-svn: 107550
* Custom inserters (e.g., conditional moves in Thumb1 can introduceJim Grosbach2010-07-021-1/+14
| | | | | | | | | | | | 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 llvm-svn: 107517
* Propagate the AlignStack bit in InlineAsm's to the Dale Johannesen2010-07-021-3/+3
| | | | | | | | | | | | | | | | | | | 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. llvm-svn: 107506
* Remove the TargetRegisterClass member from CalleeSavedInfoRafael Espindola2010-06-021-12/+19
| | | | llvm-svn: 105344
* Remove uses of getCalleeSavedRegClasses from outside theRafael Espindola2010-06-021-7/+3
| | | | | | | backends and removes the virtual declaration. With that out of the way I should be able to cleanup one backend at a time. llvm-svn: 105321
* Implement @llvm.returnaddress. rdar://8015977.Evan Cheng2010-05-221-2/+2
| | | | llvm-svn: 104421
* Rename "HasCalls" in MachineFrameInfo to "AdjustsStack" to better describe whatBill Wendling2010-05-141-15/+15
| | | | | | | | | 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. llvm-svn: 103802
* Add argument TargetRegisterInfo to loadRegFromStackSlot and storeRegToStackSlot.Evan Cheng2010-05-061-4/+5
| | | | llvm-svn: 103193
* Reword a comment slightly.Eric Christopher2010-05-031-1/+1
| | | | llvm-svn: 102966
* Make naked functions work on PPC.Dale Johannesen2010-04-291-0/+4
| | | | llvm-svn: 102657
* Rename MachineFrameInfo variables to MFI, for consistency withDan Gohman2010-04-131-41/+41
| | | | | | the rest of CodeGen. llvm-svn: 101146
* remove the MMI pointer from MachineFrameInfo.Chris Lattner2010-04-051-6/+0
| | | | llvm-svn: 100415
* Clear up the last (famous last words) frame index value reuse issues for Thumb1.Jim Grosbach2010-03-101-6/+9
| | | | llvm-svn: 98109
* Change the Value argument to eliminateFrameIndex to a type-tagged value. ThisJim Grosbach2010-03-091-2/+3
| | | | | | | | | | 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. llvm-svn: 98086
* Updated version of r96634 (which was reverted due to failing 176.gcc andJim Grosbach2010-02-221-3/+4
| | | | | | | | 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. llvm-svn: 96822
* Revert 96634. It causes assertion failures for 126.gcc and 176.gcc inBob Wilson2010-02-191-4/+3
| | | | | | the armv6 nightly tests. llvm-svn: 96691
* Radar 7636153. In the presence of large call frames, it's not sufficientJim Grosbach2010-02-191-3/+4
| | | | | | | | | 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. llvm-svn: 96634
* Teach MachineFrameInfo to track maximum alignment while stack objects are beingEvan Cheng2010-02-131-13/+2
| | | | | | | | | | 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. llvm-svn: 96069
* move target-independent opcodes out of TargetInstrInfoChris Lattner2010-02-091-1/+1
| | | | | | | | | 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. llvm-svn: 95687
* Remove dead store.Bill Wendling2009-12-281-1/+1
| | | | llvm-svn: 92187
* Honour setHasCalls() set from isel.Anton Korobeynikov2009-12-111-2/+2
| | | | | | | This is used in some weird cases like general dynamic TLS model. This fixes PR5723 llvm-svn: 91144
* improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner2009-12-031-1/+1
| | | | | | Patch by Howard Hinnant! llvm-svn: 90365
* Add a bool flag to StackObjects telling whether they reference spillDavid Greene2009-11-121-1/+2
| | | | | | | | | | | | | 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
* When the function is doing dynamic stack realignment, the spill slot will beJim Grosbach2009-10-291-2/+2
| | | | | | | | 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. llvm-svn: 85474
* Cleanup of frame index scavenging. Better code flow and more accuratelyJim Grosbach2009-10-211-35/+60
| | | | | | handles T2 and ARM use cases. llvm-svn: 84761
* Better handle instructions that re-def a scratch registerJim Grosbach2009-10-201-9/+18
| | | | llvm-svn: 84657
* Register re-use for scavenged frame indices must check for re-deginitionJim Grosbach2009-10-201-0/+4
| | | | | | of the register in the instruction which kills the scavenged value. llvm-svn: 84641
* Enable post-pass frame index register scavenging for ARM and Thumb2Jim Grosbach2009-10-201-5/+0
| | | | llvm-svn: 84585
* Distinquish stack slots from other stack objects. They (and fixed objects) ↵Evan Cheng2009-10-171-1/+1
| | | | | | get FixedStack PseudoSourceValues. llvm-svn: 84326
* Make loop not recalc getNumOperands() each time aroundJim Grosbach2009-10-141-3/+2
| | | | llvm-svn: 84138
* quiet compiler warningJim Grosbach2009-10-141-1/+1
| | | | llvm-svn: 84133
* when previous scratch register is killed, flag the value as no longer trackingJim Grosbach2009-10-091-1/+4
| | | | llvm-svn: 83653
* Re-enable register scavenging in Thumb1 by default.Jim Grosbach2009-10-081-10/+1
| | | | llvm-svn: 83521
* bugfix. The target may use virtual registers that aren't tracked for re-use ↵Jim Grosbach2009-10-081-18/+26
| | | | | | but are allocated by the scavenger. The re-use algorithm needs to watch for that. llvm-svn: 83519
* reverting thumb1 scavenging default due to test failure while I figure out ↵Jim Grosbach2009-10-071-1/+10
| | | | | | what's up. llvm-svn: 83501
* Enable thumb1 register scavenging by default.Jim Grosbach2009-10-071-10/+1
| | | | llvm-svn: 83496
* grammarJim Grosbach2009-10-071-1/+1
| | | | llvm-svn: 83483
* add initializers for clarity. Add missing assignment of PrevLastUseOp.Jim Grosbach2009-10-071-2/+3
| | | | llvm-svn: 83481
* Add register-reuse to frame-index register scavenging. When a target usesJim Grosbach2009-10-071-21/+120
| | | | | | | | | | | | | | | | | | | | 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
* Add additional assert() to verify no extraneous use of a scavenged register.Jim Grosbach2009-09-301-2/+9
| | | | llvm-svn: 83163
OpenPOWER on IntegriCloud