aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/PrologEpilogInserter.cpp
AgeCommit message (Collapse)AuthorFilesLines
2011-04-15Fix a ton of comment typos found by codespell. Patch byChris Lattner1-2/+2
Luis Felipe Strano Moraes! llvm-svn: 129558
2011-03-03Allow a target to choose whether to prefer the scavenger emergency spill slotJim Grosbach1-7/+6
be next to the frame pointer or the stack pointer. llvm-svn: 126956
2011-01-10Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs ↵Anton Korobeynikov1-12/+12
and fixes here and there. llvm-svn: 123170
2011-01-07Do not model all INLINEASM instructions as having unmodelled side effects.Evan Cheng1-1/+3
Instead encode llvm IR level property "HasSideEffects" in an operand (shared with IsAlignStack). Added MachineInstrs::hasUnmodeledSideEffects() to check the operand when the instruction is an INLINEASM. This allows memory instructions to be moved around INLINEASM instructions. llvm-svn: 123044
2010-11-27Move more PEI-related hooks to TFIAnton Korobeynikov1-2/+4
llvm-svn: 120229
2010-11-27Move callee-saved regs spills / reloads to TFIAnton Korobeynikov1-2/+3
llvm-svn: 120228
2010-11-18Move hasFP() and few related hooks to TargetFrameInfo.Anton Korobeynikov1-4/+5
llvm-svn: 119740
2010-11-15First step of huge frame-related refactoring: move emit{Prologue,Epilogue} ↵Anton Korobeynikov1-4/+4
out of TargetRegisterInfo to TargetFrameInfo, which is definitely much better suitable place llvm-svn: 119097
2010-10-27Formatting.Jim Grosbach1-2/+2
llvm-svn: 117453
2010-10-18Trivial grammar tweak.Jim Grosbach1-1/+1
llvm-svn: 116710
2010-10-12Begin adding static dependence information to passes, which will allow us toOwen Anderson1-1/+5
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. llvm-svn: 116334
2010-10-07Now with fewer extraneous semicolons!Owen Anderson1-1/+1
llvm-svn: 115996
2010-08-26Simplify eliminateFrameIndex() interface back down now that PEI doesn't needJim Grosbach1-10/+1
to try to re-use scavenged frame index reference registers. rdar://8277890 llvm-svn: 112241
2010-08-26Remove the now obsolete frame index virtual re-use algorithm from PEI. Pre-RAJim Grosbach1-148/+9
virtual base registers handle this function, and more. A bit more cleanup to do on the interface to eliminateFrameIndex() after this. llvm-svn: 112237
2010-08-25Add some statistics for PEI register scavengingJim Grosbach1-0/+7
llvm-svn: 112084
2010-08-24Move enabling the local stack allocation pass into the target where it belongs.Jim Grosbach1-5/+1
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
2010-08-23Remove the MFI storage of the local allocation block size. It's not needed.Jim Grosbach1-4/+0
llvm-svn: 111847
2010-08-23Better handling of local offsets for downwards growing stacks. This correctsJim Grosbach1-6/+8
relative offsets when there are offsets encoded in the instructions and simplifies final allocation in PEI. rdar://8277890 llvm-svn: 111836
2010-08-19Update local stack block allocation to let PEI do the allocs if no additionalJim Grosbach1-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
2010-08-17Add materialization of virtual base registers for frame indices allocated intoJim Grosbach1-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
2010-08-16tidy up. remove unused local.Jim Grosbach1-0/+2
llvm-svn: 111206
2010-08-16Better handle alignment requirements for local objects in pre-regalloc frameJim Grosbach1-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
2010-08-14Add a local stack object block allocation pass. This is still anJim Grosbach1-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
2010-08-06Cleanup comment wordingJim Grosbach1-3/+3
llvm-svn: 110466
2010-07-27It's better to have the arrays, which would trigger the creation of stackBill Wendling1-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
2010-07-21Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson1-2/+2
llvm-svn: 109045
2010-07-08Clean up scavengeRegister() a bit to prefer available regs, which allowsJim Grosbach1-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
2010-07-08When processing frame index virtual registers, consider all available registersJim Grosbach1-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
2010-07-03Remove isSS argument from CreateFixedObject. Fixed objects cannot be spill ↵Evan Cheng1-2/+1
slots so it's always false. llvm-svn: 107550
2010-07-02Custom inserters (e.g., conditional moves in Thumb1 can introduceJim Grosbach1-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
2010-07-02Propagate the AlignStack bit in InlineAsm's to the Dale Johannesen1-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
2010-06-02Remove the TargetRegisterClass member from CalleeSavedInfoRafael Espindola1-12/+19
llvm-svn: 105344
2010-06-02Remove uses of getCalleeSavedRegClasses from outside theRafael Espindola1-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
2010-05-22Implement @llvm.returnaddress. rdar://8015977.Evan Cheng1-2/+2
llvm-svn: 104421
2010-05-14Rename "HasCalls" in MachineFrameInfo to "AdjustsStack" to better describe whatBill Wendling1-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
2010-05-06Add argument TargetRegisterInfo to loadRegFromStackSlot and storeRegToStackSlot.Evan Cheng1-4/+5
llvm-svn: 103193
2010-05-03Reword a comment slightly.Eric Christopher1-1/+1
llvm-svn: 102966
2010-04-29Make naked functions work on PPC.Dale Johannesen1-0/+4
llvm-svn: 102657
2010-04-13Rename MachineFrameInfo variables to MFI, for consistency withDan Gohman1-41/+41
the rest of CodeGen. llvm-svn: 101146
2010-04-05remove the MMI pointer from MachineFrameInfo.Chris Lattner1-6/+0
llvm-svn: 100415
2010-03-10Clear up the last (famous last words) frame index value reuse issues for Thumb1.Jim Grosbach1-6/+9
llvm-svn: 98109
2010-03-09Change the Value argument to eliminateFrameIndex to a type-tagged value. ThisJim Grosbach1-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
2010-02-22Updated version of r96634 (which was reverted due to failing 176.gcc andJim Grosbach1-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
2010-02-19Revert 96634. It causes assertion failures for 126.gcc and 176.gcc inBob Wilson1-4/+3
the armv6 nightly tests. llvm-svn: 96691
2010-02-19Radar 7636153. In the presence of large call frames, it's not sufficientJim Grosbach1-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
2010-02-13Teach MachineFrameInfo to track maximum alignment while stack objects are beingEvan Cheng1-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
2010-02-09move target-independent opcodes out of TargetInstrInfoChris Lattner1-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
2009-12-28Remove dead store.Bill Wendling1-1/+1
llvm-svn: 92187
2009-12-11Honour setHasCalls() set from isel.Anton Korobeynikov1-2/+2
This is used in some weird cases like general dynamic TLS model. This fixes PR5723 llvm-svn: 91144
2009-12-03improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner1-1/+1
Patch by Howard Hinnant! llvm-svn: 90365