summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/PrologEpilogInserter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51899 91177308-0d34-0410-b5e6-96231b3b80d8
* Use precomputed value, if anyAnton Korobeynikov2008-04-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50164 91177308-0d34-0410-b5e6-96231b3b80d8
* CleanupAnton Korobeynikov2008-04-231-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50160 91177308-0d34-0410-b5e6-96231b3b80d8
* detabify llvm, patch by Mike Stump!Chris Lattner2008-03-201-36/+36
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48577 91177308-0d34-0410-b5e6-96231b3b80d8
* Miscellaneous clean-ups based on Evan's feedback:Bill Wendling2008-03-031-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47870 91177308-0d34-0410-b5e6-96231b3b80d8
* Multiple instructions can be inserted when eliminating frame indexes. We needBill Wendling2008-03-031-7/+24
| | | | | | | | | the register scavenger to process all of those new instructions instead of just the last one inserted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47860 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't track max alignment during stack object allocations since they can be ↵Evan Cheng2008-02-271-2/+1
| | | | | | deleted later. Let PEI compute it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47668 91177308-0d34-0410-b5e6-96231b3b80d8
* Spiller now remove unused spill slots.Evan Cheng2008-02-271-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47657 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust the MaxAlignment for the special register scavenging spill slot.Bill Wendling2008-02-211-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47452 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-101-11/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46930 91177308-0d34-0410-b5e6-96231b3b80d8
* SDIsel processes llvm.dbg.declare by recording the variable debug ↵Evan Cheng2008-02-021-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46659 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the nasty LABEL hack with a much less evil one. Now ↵Evan Cheng2008-02-011-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46635 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an extra operand to LABEL nodes which distinguishes between debug, EH, ↵Evan Cheng2008-01-311-1/+1
| | | | | | or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46609 91177308-0d34-0410-b5e6-96231b3b80d8
* Also avoid adding callee save code before debug labels.Evan Cheng2008-01-311-1/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46586 91177308-0d34-0410-b5e6-96231b3b80d8
* rename TargetInstrDescriptor -> TargetInstrDesc.Chris Lattner2008-01-071-3/+3
| | | | | | | | Make MachineInstr::getDesc return a reference instead of a pointer, since it can never be null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45695 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptorChris Lattner2008-01-071-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45680 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflectsChris Lattner2008-01-071-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45674 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unused variable.Duncan Sands2008-01-061-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45655 91177308-0d34-0410-b5e6-96231b3b80d8
* I should not be allowed to commit when sleepy.Owen Anderson2008-01-051-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45608 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some more instruction creation methods from RegisterInfo into InstrInfo.Owen Anderson2008-01-011-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45484 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename SSARegMap -> MachineRegisterInfo in keeping with the idea Chris Lattner2007-12-311-4/+5
| | | | | | | | | | | | | | | | that "machine" classes are used to represent the current state of the code being compiled. Given this expanded name, we can start moving other stuff into it. For now, move the UsedPhysRegs and LiveIn/LoveOuts vectors from MachineFunction into it. Update all the clients to match. This also reduces some needless #includes, such as MachineModuleInfo from MachineFunction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45467 91177308-0d34-0410-b5e6-96231b3b80d8
* MachineOperand::getImmedValue -> MachineOperand::getImmChris Lattner2007-12-301-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45454 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a argument to storeRegToStackSlot and storeRegToAddr to specify whetherEvan Cheng2007-12-051-1/+1
| | | | | | | the stored register is killed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44600 91177308-0d34-0410-b5e6-96231b3b80d8
* Long live the exception handling!Anton Korobeynikov2007-07-141-2/+2
| | | | | | | | | | | | | | | | This patch fills the last necessary bits to enable exceptions handling in LLVM. Currently only on x86-32/linux. In fact, this patch adds necessary intrinsics (and their lowering) which represent really weird target-specific gcc builtins used inside unwinder. After corresponding llvm-gcc patch will land (easy) exceptions should be more or less workable. However, exceptions handling support should not be thought as 'finished': I expect many small and not so small glitches everywhere. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39855 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1424.Lauro Ramos Venancio2007-05-311-1/+1
| | | | | | | | When a function has FP, the register scavenging spill slot offset already was calculated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37371 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop 'const'Devang Patel2007-05-031-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-2/+2
| | | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
* If call frame is not part of stack frame and no dynamic alloc, ↵Evan Cheng2007-05-011-14/+44
| | | | | | eliminateFrameIndex() must adjust SP offset with size of call frames. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36625 91177308-0d34-0410-b5e6-96231b3b80d8
* Under normal circumstances, when a frame pointer is not required, we reserveEvan Cheng2007-05-011-17/+14
| | | | | | | | | | | | | argument space for call sites in the function immediately on entry to the current function. This eliminates the need for add/sub sp brackets around call sites. However, this is not always a good idea. If the "call frame" is large and the target load / store instructions have small immediate field to encode sp offset, this can cause poor codegen. In the worst case, this can make it impossible to scavenge a register if the reserved spill slot is pushed too far apart from sp / fp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36607 91177308-0d34-0410-b5e6-96231b3b80d8
* Match MachineFunction::UsedPhysRegs changes.Evan Cheng2007-04-251-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36452 91177308-0d34-0410-b5e6-96231b3b80d8
* support for >4G stack framesChris Lattner2007-04-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36425 91177308-0d34-0410-b5e6-96231b3b80d8
* support > 4G stack objectsChris Lattner2007-04-251-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36422 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug introduced with my previous patch, where it didn't correctly handleChris Lattner2007-04-091-7/+9
| | | | | | | | instructions which replace themselves when FI's are rewritten (common on ppc). This fixes CodeGen/PowerPC/2006-10-17-ppc64-alloca.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35789 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll and PR1308:Chris Lattner2007-04-091-1/+5
| | | | | | | | some instructions can have multiple frame indices in them. If this happens, rewrite all of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35785 91177308-0d34-0410-b5e6-96231b3b80d8
* If target decides to create an emergency spill slot, make sure it's closest ↵Evan Cheng2007-03-061-7/+56
| | | | | | to SP or frame pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34965 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete register scavenger when done with it.Evan Cheng2007-03-011-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34786 91177308-0d34-0410-b5e6-96231b3b80d8
* Interface clean up.Evan Cheng2007-03-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34772 91177308-0d34-0410-b5e6-96231b3b80d8
* add a newline at end of fileChris Lattner2007-02-281-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34735 91177308-0d34-0410-b5e6-96231b3b80d8
* Make requiresRegisterScavenging determination on a per MachineFunction basis.Evan Cheng2007-02-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34711 91177308-0d34-0410-b5e6-96231b3b80d8
* MRegisterInfo disowns RegScavenger. It's immutable.Evan Cheng2007-02-281-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34706 91177308-0d34-0410-b5e6-96231b3b80d8
* Let MRegisterInfo now owns RegScavenger.Evan Cheng2007-02-271-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34691 91177308-0d34-0410-b5e6-96231b3b80d8
* forward() should not increment internal iterator. Its client may insert ↵Evan Cheng2007-02-271-1/+1
| | | | | | instruction between now and next forward() call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34649 91177308-0d34-0410-b5e6-96231b3b80d8
* First potential client of register scavenger.Evan Cheng2007-02-231-4/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34516 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the MachineDebugInfo to MachineModuleInfo to better reflect usageJim Laskey2007-01-261-3/+3
| | | | | | | for debugging and exception handling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33550 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a MRegisterInfo hook that tells PEI the target is responsible forEvan Cheng2007-01-251-2/+3
| | | | | | | rounding the stack frame to a multiple of stack alignment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33504 91177308-0d34-0410-b5e6-96231b3b80d8
* PEI is now responsible for adding MaxCallFrameSize to frame size and align ↵Evan Cheng2007-01-231-1/+16
| | | | | | the stack. Each target can further adjust the frame size if necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33460 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unused variable.Evan Cheng2007-01-201-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33396 91177308-0d34-0410-b5e6-96231b3b80d8
* We not align the final stack slot but instead let the target do so in ↵Evan Cheng2007-01-201-7/+0
| | | | | | emitPrologue(). Each target can make adjustments to the stack frame and re-align the stack as it deem appropriate. Do not align it twice which can end up wasting stack space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33387 91177308-0d34-0410-b5e6-96231b3b80d8