summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PrologEpilogInserter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* replace TRI->isVirtualRegister() with TargetRegisterInfo::isVirtualRegister()Jim Grosbach2009-09-301-3/+1
| | | | | | per customary usage llvm-svn: 83137
* fix compiler warningJim Grosbach2009-09-301-1/+1
| | | | llvm-svn: 83132
* Simplify the tracking of virtual frame index registers. Ranges cannot overlap,Jim Grosbach2009-09-291-20/+31
| | | | | | | so a simple "current register" will suffice. Also add some additional sanity-checking assertions to make sure things are as we expect. llvm-svn: 83081
* Use explicit structs instead of std::pair to map callee saved regs to spill ↵Tilmann Scheller2009-09-271-4/+4
| | | | | | slots. llvm-svn: 82909
* pr4926: ARM requires the stack pointer to be aligned, even for leaf functions.Bob Wilson2009-09-251-14/+20
| | | | | | | | | | | | | | | | | | | | For the AAPCS ABI, SP must always be 4-byte aligned, and at any "public interface" it must be 8-byte aligned. For the older ARM APCS ABI, the stack alignment is just always 4 bytes. For X86, we currently align SP at entry to a function (e.g., to 16 bytes for Darwin), but no stack alignment is needed at other times, such as for a leaf function. After discussing this with Dan, I decided to go with the approach of adding a new "TransientStackAlignment" field to TargetFrameInfo. This value specifies the stack alignment that must be maintained even in between calls. It defaults to 1 except for ARM, where it is 4. (Some other targets may also want to set this if they have similar stack requirements. It's not currently required for PPC because it sets targetHandlesStackFrameRounding and handles the alignment in target-specific code.) The existing StackAlignment value specifies the alignment upon entry to a function, which is how we've been using it anyway. llvm-svn: 82767
* Start of revamping the register scavenging in PEI. ARM Thumb1 is the drivingJim Grosbach2009-09-241-3/+62
| | | | | | | | | | | | | | | | | | | interest for this, as it currently reserves a register rather than using the scavenger for matierializing constants as needed. Instead of scavenging registers on the fly while eliminating frame indices, new virtual registers are created, and then a scavenged collectively in a post-pass over the function. This isolates the bits that need to interact with the scavenger, and sets the stage for more intelligent use, and reuse, of scavenged registers. For the time being, this is disabled by default. Once the bugs are worked out, the current scavenging calls in replaceFrameIndices() will be removed and the post-pass scavenging will be the default. Until then, -enable-frame-index-scavenging enables the new code. Currently, only the Thumb1 back end is set up to use it. llvm-svn: 82734
* Fix a hypothetical problem for targets with StackGrowsUp and a non-zeroBob Wilson2009-09-241-4/+5
| | | | | | | | | | | | | LocalAreaOffset. (We don't have any of those right now.) PEI::calculateFrameObjectOffsets includes the absolute value of the LocalAreaOffset in the cumulative offset value used to calculate the stack frame size. It then adds the raw value of the LocalAreaOffset to the stack size. For a StackGrowsDown target, that raw value is negative and has the effect of cancelling out the absolute value that was added earlier, but that obviously won't work for a StackGrowsUp target. Change to subtract the absolute value of the LocalAreaOffset. llvm-svn: 82693
* Edit a comment.Bob Wilson2009-09-231-2/+1
| | | | llvm-svn: 82641
* Fix a comment typo and some whitespace.Bob Wilson2009-09-181-2/+2
| | | | llvm-svn: 82285
* Record variable debug info at ISel time directly.Devang Patel2009-08-221-5/+0
| | | | llvm-svn: 79742
* Don't setCalleeSavedInfoValid() until spills are interted.Jakob Stoklund Olesen2009-08-151-2/+2
| | | | | | | | | | In a naked function, the flag is never set and getPristineRegs() returns an empty list. That means naked functions are able to clobber callee saved registers, but that is the whole point of naked functions. This fixes PR4716. llvm-svn: 79096
* Add MachineFrameInfo::getPristineRegisters(MBB) method.Jakob Stoklund Olesen2009-08-131-0/+2
| | | | llvm-svn: 78911
* Use setPreservesAll and setPreservesCFG in CodeGen passes.Dan Gohman2009-07-311-0/+1
| | | | llvm-svn: 77754
* Reapply r77654 with a fix: MachineFunctionPass's getAnalysisUsageDan Gohman2009-07-311-1/+0
| | | | | | | | shouldn't do AU.setPreservesCFG(), because even though CodeGen passes don't modify the LLVM IR CFG, they may modify the MachineFunction CFG, and passes like MachineLoop are registered with isCFGOnly set to true. llvm-svn: 77691
* Revert r77654, it appears to be causing llvm-gcc bootstrap failures, and manyDaniel Dunbar2009-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | failures when building assorted projects with clang. --- Reverse-merging r77654 into '.': U include/llvm/CodeGen/Passes.h U include/llvm/CodeGen/MachineFunctionPass.h U include/llvm/CodeGen/MachineFunction.h U include/llvm/CodeGen/LazyLiveness.h U include/llvm/CodeGen/SelectionDAGISel.h D include/llvm/CodeGen/MachineFunctionAnalysis.h U include/llvm/Function.h U lib/Target/CellSPU/SPUISelDAGToDAG.cpp U lib/Target/PowerPC/PPCISelDAGToDAG.cpp U lib/CodeGen/LLVMTargetMachine.cpp U lib/CodeGen/MachineVerifier.cpp U lib/CodeGen/MachineFunction.cpp U lib/CodeGen/PrologEpilogInserter.cpp U lib/CodeGen/MachineLoopInfo.cpp U lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp D lib/CodeGen/MachineFunctionAnalysis.cpp D lib/CodeGen/MachineFunctionPass.cpp U lib/CodeGen/LiveVariables.cpp llvm-svn: 77661
* Manage MachineFunctions with an analysis Pass instead of the AnnotableDan Gohman2009-07-311-1/+0
| | | | | | | mechanism. To support this, make MachineFunctionPass a little more complete. llvm-svn: 77654
* Add support for naked functionsAnton Korobeynikov2009-07-171-2/+5
| | | | llvm-svn: 76198
* Assume an inline asm might be a call, so we getDale Johannesen2009-07-161-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
* Scan for presence of calls and determine max callframe size early. To allow ↵Anton Korobeynikov2009-07-161-25/+36
| | | | | | ProcessFunctionBeforeCalleeSaveScan() use this information llvm-svn: 75942
* Targets sometimes assign fixed stack object to spill certain callee-savedEvan Cheng2009-07-091-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
* Use interators instead of counters for loops.Bill Wendling2009-07-081-16/+21
| | | | llvm-svn: 75046
* Removing the HasBuiltinSetjmp flag and associated bits. Flagging the presenceJim Grosbach2009-05-131-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
* PEI: rename PEI.h to PrologEpilogInserter.h to adhere to file naming standardJohn Mosby2009-05-131-1/+1
| | | | llvm-svn: 71678
* Add support for GCC compatible builtin setjmp and longjmp intrinsics. This isJim Grosbach2009-05-121-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
* Restructure PEI code:John Mosby2009-05-121-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
* Apply patch review feedback.Evan Cheng2009-05-111-0/+2
| | | | llvm-svn: 71472
* Unbreak non-debug build.Evan Cheng2009-05-111-0/+8
| | | | llvm-svn: 71457
* Shrink wrapping in PEI:John Mosby2009-05-111-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
* Shrink wrapping in PEI: initial release. Finishing development, enable with ↵John Mosby2009-03-271-43/+913
| | | | | | --shrink-wrap. llvm-svn: 67828
* Fix PR3845: Avoid stale MachineInstruction pointer reference.Evan Cheng2009-03-241-3/+1
| | | | llvm-svn: 67649
* Apply the patch requested in PR3846.Chris Lattner2009-03-201-1/+1
| | | | llvm-svn: 67364
* Fix PEI to not walk off the start of a block when an updated instructionChris Lattner2009-03-191-2/+6
| | | | | | is the first in its block. This is PR3842. llvm-svn: 67304
* Rename getAnalysisToUpdate to getAnalysisIfAvailable.Duncan Sands2009-01-281-1/+1
| | | | llvm-svn: 63198
* Refactor code that adjusts the offsets of stack objects.Bill Wendling2008-11-071-79/+34
| | | | llvm-svn: 58829
* Don't recalculate the stack position of the stack protector.Bill Wendling2008-11-061-0/+2
| | | | llvm-svn: 58815
* - Rename stackprotector_{prologue,epilogue} to stackprotector_{create,check}.Bill Wendling2008-11-061-1/+1
| | | | | | | - Get rid of "HasStackProtector" in MachineFrameInfo. - Modify intrinsics to tell which are doing what with memory. llvm-svn: 58799
* Implement the stack protector stack accesses via intrinsics:Bill Wendling2008-11-061-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
* Revert r58489. It isn't correct for all cases.Bill Wendling2008-10-311-2/+2
| | | | llvm-svn: 58523
* Don't skip over all "terminator" instructions when determining where to put theBill Wendling2008-10-311-2/+2
| | | | | | | callee-saved restore code. It could skip over conditional jumps accidentally. Instead, just skip the "return" instructions. llvm-svn: 58489
* Switch the MachineOperand accessors back to the short names likeDan Gohman2008-10-031-1/+1
| | | | | | isReg, etc., from isRegister, etc. llvm-svn: 57006
* Instead of setPreservesAll, just mark them preseving machine loop info and ↵Evan Cheng2008-09-221-1/+2
| | | | | | machine dominators. llvm-svn: 56475
* Mark several codegen passes as preserving all analysis.Evan Cheng2008-09-221-0/+5
| | | | llvm-svn: 56469
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Fix a comment to say nonnegative instead of positive.Dan Gohman2008-07-161-1/+1
| | | | llvm-svn: 53681
* No need to align the stack if there are no stackDale Johannesen2008-06-301-1/+2
| | | | | | objects. Fixes a couple of tests on Linux. llvm-svn: 52921
* Fixes the last x86-64 test failure in compat.exp:Dale Johannesen2008-06-261-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
* Fixed bug in bad behavior in calculateFrameObjectOffsets,Bruno Cardoso Lopes2008-06-031-1/+2
| | | | | | | the solution commited is different from the previous patch to avoid int and unsigned comparison llvm-svn: 51899
* Use precomputed value, if anyAnton Korobeynikov2008-04-231-1/+1
| | | | llvm-svn: 50164
* CleanupAnton Korobeynikov2008-04-231-3/+5
| | | | llvm-svn: 50160
* detabify llvm, patch by Mike Stump!Chris Lattner2008-03-201-36/+36
| | | | llvm-svn: 48577
OpenPOWER on IntegriCloud