aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/PrologEpilogInserter.cpp
AgeCommit message (Collapse)AuthorFilesLines
2009-07-17Add support for naked functionsAnton Korobeynikov1-2/+5
llvm-svn: 76198
2009-07-16Assume an inline asm might be a call, so we getDale Johannesen1-0/+4
stack alignment right when it is. This is not ideal but conservatively correct. Adjust a test to compensate for changed stack offset value. gcc.apple/asm-block-57.c llvm-svn: 76120
2009-07-16Scan for presence of calls and determine max callframe size early. To allow ↵Anton Korobeynikov1-25/+36
ProcessFunctionBeforeCalleeSaveScan() use this information llvm-svn: 75942
2009-07-09Targets sometimes assign fixed stack object to spill certain callee-savedEvan Cheng1-1/+6
registers based on dynamic conditions. For example, X86 EBP/RBP, when used as frame register has to be spilled in the first fixed object. It should inform PEI this so it doesn't get allocated another stack object. Also, it should not be spilled as other callee-saved registers but rather its spilling and restoring are being handled by emitPrologue and emitEpilogue. Avoid spilling it twice. llvm-svn: 75116
2009-07-08Use interators instead of counters for loops.Bill Wendling1-16/+21
llvm-svn: 75046
2009-05-13Removing the HasBuiltinSetjmp flag and associated bits. Flagging the presenceJim Grosbach1-1/+1
of exception handling builtin sjlj targets in functions turns out not to be necessary. Marking the intrinsic implementation in the .td file as defining all registers is sufficient to get the context saved properly by the containing function. llvm-svn: 71743
2009-05-13PEI: rename PEI.h to PrologEpilogInserter.h to adhere to file naming standardJohn Mosby1-1/+1
llvm-svn: 71678
2009-05-12Add support for GCC compatible builtin setjmp and longjmp intrinsics. This isJim Grosbach1-1/+1
a supporting preliminary patch for GCC-compatible SjLJ exception handling. Note that these intrinsics are not designed to be invoked directly by the user, but rather used by the front-end as target hooks for exception handling. llvm-svn: 71610
2009-05-12Restructure PEI code:John Mosby1-1307/+67
- moved shrink wrapping code from PrologEpilogInserter.cpp to new file ShrinkWrapping.cpp. - moved PEI pass definition into new shared header PEI.h. llvm-svn: 71588
2009-05-11Apply patch review feedback.Evan Cheng1-0/+2
llvm-svn: 71472
2009-05-11Unbreak non-debug build.Evan Cheng1-0/+8
llvm-svn: 71457
2009-05-11Shrink wrapping in PEI:John Mosby1-610/+1066
- reduces _static_ callee saved register spills and restores similar to Chow's original algorithm. - iterative implementation with simple heuristic limits to mitigate compile time impact. - handles placing spills/restores for multi-entry, multi-exit regions in the Machine CFG without splitting edges. - passes test-suite in LLCBETA mode. Added contains() method to ADT/SparseBitVector. llvm-svn: 71438
2009-03-27Shrink wrapping in PEI: initial release. Finishing development, enable with ↵John Mosby1-43/+913
--shrink-wrap. llvm-svn: 67828
2009-03-24Fix PR3845: Avoid stale MachineInstruction pointer reference.Evan Cheng1-3/+1
llvm-svn: 67649
2009-03-20Apply the patch requested in PR3846.Chris Lattner1-1/+1
llvm-svn: 67364
2009-03-19Fix PEI to not walk off the start of a block when an updated instructionChris Lattner1-2/+6
is the first in its block. This is PR3842. llvm-svn: 67304
2009-01-28Rename getAnalysisToUpdate to getAnalysisIfAvailable.Duncan Sands1-1/+1
llvm-svn: 63198
2008-11-07Refactor code that adjusts the offsets of stack objects.Bill Wendling1-79/+34
llvm-svn: 58829
2008-11-06Don't recalculate the stack position of the stack protector.Bill Wendling1-0/+2
llvm-svn: 58815
2008-11-06- Rename stackprotector_{prologue,epilogue} to stackprotector_{create,check}.Bill Wendling1-1/+1
- Get rid of "HasStackProtector" in MachineFrameInfo. - Modify intrinsics to tell which are doing what with memory. llvm-svn: 58799
2008-11-06Implement the stack protector stack accesses via intrinsics:Bill Wendling1-0/+27
- stackprotector_prologue creates a stack object and stores the guard there. - stackprotector_epilogue reads the stack guard from the stack position created by stackprotector_prologue. - The PrologEpilogInserter was changed to make sure that the stack guard is first on the stack frame. llvm-svn: 58791
2008-10-31Revert r58489. It isn't correct for all cases.Bill Wendling1-2/+2
llvm-svn: 58523
2008-10-31Don't skip over all "terminator" instructions when determining where to put theBill Wendling1-2/+2
callee-saved restore code. It could skip over conditional jumps accidentally. Instead, just skip the "return" instructions. llvm-svn: 58489
2008-10-03Switch the MachineOperand accessors back to the short names likeDan Gohman1-1/+1
isReg, etc., from isRegister, etc. llvm-svn: 57006
2008-09-22Instead of setPreservesAll, just mark them preseving machine loop info and ↵Evan Cheng1-1/+2
machine dominators. llvm-svn: 56475
2008-09-22Mark several codegen passes as preserving all analysis.Evan Cheng1-0/+5
llvm-svn: 56469
2008-09-04Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman1-1/+1
llvm-svn: 55779
2008-07-16Fix a comment to say nonnegative instead of positive.Dan Gohman1-1/+1
llvm-svn: 53681
2008-06-30No need to align the stack if there are no stackDale Johannesen1-1/+2
objects. Fixes a couple of tests on Linux. llvm-svn: 52921
2008-06-26Fixes the last x86-64 test failure in compat.exp:Dale Johannesen1-2/+6
<16 x float> is 64-byte aligned (for some reason), which gets us into the stack realignment code. The computation changing FP-relative offsets to SP-relative was broken, assiging a spill temp to a location also used for parameter passing. This fixes it by rounding up the stack frame to a multiple of the largest alignment (I concluded it wasn't fixable without doing this, but I'm not very sure.) llvm-svn: 52750
2008-06-03Fixed bug in bad behavior in calculateFrameObjectOffsets,Bruno Cardoso Lopes1-1/+2
the solution commited is different from the previous patch to avoid int and unsigned comparison llvm-svn: 51899
2008-04-23Use precomputed value, if anyAnton Korobeynikov1-1/+1
llvm-svn: 50164
2008-04-23CleanupAnton Korobeynikov1-3/+5
llvm-svn: 50160
2008-03-20detabify llvm, patch by Mike Stump!Chris Lattner1-36/+36
llvm-svn: 48577
2008-03-03Miscellaneous clean-ups based on Evan's feedback:Bill Wendling1-42/+52
- Cleaned up how the prologue-epilogue inserter loops over the instructions. - Instead of restarting the processing of an instruction if we remove an implicit kill, just update the end iterator and make sure that the iterator isn't incremented. llvm-svn: 47870
2008-03-03Multiple instructions can be inserted when eliminating frame indexes. We needBill Wendling1-7/+24
the register scavenger to process all of those new instructions instead of just the last one inserted. llvm-svn: 47860
2008-02-27Don't track max alignment during stack object allocations since they can be ↵Evan Cheng1-2/+1
deleted later. Let PEI compute it. llvm-svn: 47668
2008-02-27Spiller now remove unused spill slots.Evan Cheng1-0/+2
llvm-svn: 47657
2008-02-21Adjust the MaxAlignment for the special register scavenging spill slot.Bill Wendling1-0/+3
llvm-svn: 47452
2008-02-10Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman1-11/+11
llvm-svn: 46930
2008-02-02SDIsel processes llvm.dbg.declare by recording the variable debug ↵Evan Cheng1-2/+5
information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc. Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes. For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time. llvm-svn: 46659
2008-02-01Remove the nasty LABEL hack with a much less evil one. Now ↵Evan Cheng1-7/+0
llvm.dbg.func.start implies a stoppoint is set. SelectionDAGISel records a new source line but does not create a ISD::LABEL node for this special stoppoint. Asm printer will magically print this label. This ensures nothing is emitted before. llvm-svn: 46635
2008-01-31Add an extra operand to LABEL nodes which distinguishes between debug, EH, ↵Evan Cheng1-1/+1
or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution. llvm-svn: 46609
2008-01-31Also avoid adding callee save code before debug labels.Evan Cheng1-1/+9
llvm-svn: 46586
2008-01-07rename TargetInstrDescriptor -> TargetInstrDesc.Chris Lattner1-3/+3
Make MachineInstr::getDesc return a reference instead of a pointer, since it can never be null. llvm-svn: 45695
2008-01-07Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptorChris Lattner1-3/+2
llvm-svn: 45680
2008-01-07Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflectsChris Lattner1-1/+1
that it is cheap and efficient to get. Move a variety of predicates from TargetInstrInfo into TargetInstrDescriptor, which makes it much easier to query a predicate when you don't have TII around. Now you can use MI->getDesc()->isBranch() instead of going through TII, and this is much more efficient anyway. Not all of the predicates have been moved over yet. Update old code that used MI->getInstrDescriptor()->Flags to use the new predicates in many places. llvm-svn: 45674
2008-01-06Remove an unused variable.Duncan Sands1-1/+0
llvm-svn: 45655
2008-01-05I should not be allowed to commit when sleepy.Owen Anderson1-2/+2
llvm-svn: 45608
2008-01-01Move some more instruction creation methods from RegisterInfo into InstrInfo.Owen Anderson1-4/+4
llvm-svn: 45484