summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86FrameLowering.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Use the existing DebugLoc.Eric Christopher2012-10-021-1/+1
| | | | llvm-svn: 165051
* Make the location a parameter since we may not want the next oneEric Christopher2012-10-021-7/+10
| | | | | | in the block. llvm-svn: 165050
* Remove the `hasFnAttr' method from Function.Bill Wendling2012-09-261-1/+1
| | | | | | | The hasFnAttr method has been replaced by querying the Attributes explicitly. No intended functionality change. llvm-svn: 164725
* With r160248 in place this code is no longer needed.Chad Rosier2012-07-161-2/+0
| | | | llvm-svn: 160293
* This CL changes the function prologue and epilogue emitted on X86 when stack ↵Alexey Samsonov2012-07-161-53/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | needs realignment. It is intended to fix PR11468. Old prologue and epilogue looked like this: push %rbp mov %rsp, %rbp and $alignment, %rsp push %r14 push %r15 ... pop %r15 pop %r14 mov %rbp, %rsp pop %rbp The problem was to reference the locations of callee-saved registers in exception handling: locations of callee-saved had to be re-calculated regarding the stack alignment operation. It would take some effort to implement this in LLVM, as currently MachineLocation can only have the form "Register + Offset". Funciton prologue and epilogue are now changed to: push %rbp mov %rsp, %rbp push %14 push %15 and $alignment, %rsp ... lea -$size_of_saved_registers(%rbp), %rsp pop %r15 pop %r14 pop %rbp Reviewed by Chad Rosier. llvm-svn: 160248
* Move [get|set]BasePtrStackAdjustment() from MachineFrameInfo toChad Rosier2012-07-101-2/+2
| | | | | | | X86MachineFunctionInfo as this is currently only used by X86. If this ever becomes an issue on another arch (e.g., ARM) then we can hoist it back out. llvm-svn: 160009
* Add support for dynamic stack realignment in the presence of dynamic allocas onChad Rosier2012-07-101-4/+47
| | | | | | | | | | | | | X86. Basically, this is a reapplication of r158087 with a few fixes. Specifically, (1) the stack pointer is restored from the base pointer before popping callee-saved registers and (2) in obscure cases (see comments in patch) we must cache the value of the original stack adjustment in the prologue and apply it in the epilogue. rdar://11496434 llvm-svn: 160002
* Make X86 call and return instructions non-variadic.Jakob Stoklund Olesen2012-07-041-2/+1
| | | | | | | Function argument and return value registers aren't part of the encoding, so they should be implicit operands. llvm-svn: 159728
* Functions calling __builtin_eh_return must have a frame pointer.Jakob Stoklund Olesen2012-06-221-1/+1
| | | | | | | | | | | | | | The code in X86TargetLowering::LowerEH_RETURN() assumes that a frame pointer exists, but the frame pointer was forced by the presence of llvm.eh.unwind.init which isn't guaranteed. If llvm.eh.unwind.init is actually required in functions calling eh.return (is it?), we should diagnose that instead of emitting bad machine code. This should fix the dragonegg-x86_64-linux-gcc-4.6-test bot. llvm-svn: 158961
* Temporarily revert r158087.Chandler Carruth2012-06-181-35/+4
| | | | | | | | | | | | | This patch causes problems when both dynamic stack realignment and dynamic allocas combine in the same function. With this patch, we no longer build the epilog correctly, and silently restore registers from the wrong position in the stack. Thanks to Matt for tracking this down, and getting at least an initial test case to Chad. I'm going to try to check a variation of that test case in so we can easily track the fixes required. llvm-svn: 158654
* Add support for dynamic stack realignment in the presence of dynamic allocas onChad Rosier2012-06-061-4/+35
| | | | | | | X86. rdar://11496434 llvm-svn: 158087
* Switch all register list clients to the new MC*Iterator interface.Jakob Stoklund Olesen2012-06-011-2/+2
| | | | | | | | | | | | | No functional change intended. Sorry for the churn. The iterator classes are supposed to help avoid giant commits like this one in the future. The TableGen-produced register lists are getting quite large, and it may be necessary to change the table representation. This makes it possible to do so without changing all clients (again). llvm-svn: 157854
* Use uint16_t to store register number in static tables to match other tables.Craig Topper2012-05-241-7/+7
| | | | llvm-svn: 157374
* Tidy up naming for consistency and other cleanup. No functional change ↵Chad Rosier2012-05-231-10/+9
| | | | | | intended. llvm-svn: 157358
* X86: Use StackRegister instead of FrameRegister in getFrameIndexReference ↵Alexey Samsonov2012-05-011-0/+12
| | | | | | (to generate debug info for local variables) if stack needs realignment llvm-svn: 155917
* Use uint16_t to store register overlaps to reduce static data.Craig Topper2012-03-041-5/+5
| | | | llvm-svn: 152001
* Emacs-tag and some comment fix for all ARM, CellSPU, Hexagon, MBlaze, ↵Jia Liu2012-02-181-1/+1
| | | | | | MSP430, PPC, PTX, Sparc, X86, XCore. llvm-svn: 150878
* Use LEA to adjust stack ptr for Atom. Patch by Andy Zhang.Evan Cheng2012-02-071-20/+42
| | | | llvm-svn: 150008
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-20/+14
| | | | llvm-svn: 148578
* Fix off-by-one error.Bill Wendling2012-01-131-1/+1
| | | | llvm-svn: 148077
* Fix the code that was WRONG.Bill Wendling2012-01-121-13/+6
| | | | | | | The registers are placed into the saved registers list in the reverse order, which is why the original loop was written to loop backwards. llvm-svn: 148064
* Support segmented stacks on 64-bit FreeBSD.Rafael Espindola2012-01-121-2/+8
| | | | | | | This patch uses tcb_spare field in the tcb structure to store info. Patch by Jyun-Yan You. llvm-svn: 148041
* Support segmented stacks on win32.Rafael Espindola2012-01-121-7/+17
| | | | | | | Uses the pvArbitrary slot of the TIB, which is reserved for applications. We only support frames with a static size. llvm-svn: 148040
* After Jakob's r147938 exception handling on i386 was completely broken.Benjamin Kramer2012-01-121-0/+7
| | | | | | | | | Restore the (obviously wrong) behavior from before r147938 without relying on undefined behavior. Add a fat FIXME note. This should fix nightly tester failures. llvm-svn: 148030
* Support segmented stacks on mac.Rafael Espindola2012-01-111-15/+68
| | | | | | | | This uses TLS slot 90, which actually belongs to JavaScriptCore. We only support frames with static size Patch by Brian Anderson. llvm-svn: 147960
* Generate the segmented stack prologue for fastcc too.Rafael Espindola2012-01-111-1/+2
| | | | | | Patch by Brian Anderson. llvm-svn: 147958
* Use unsigned comparison in segmented stack prologue.Rafael Espindola2012-01-111-1/+1
| | | | | | | | This is a comparison of two addresses, and GCC does the comparison unsigned. Patch by Brian Anderson. llvm-svn: 147954
* Explicitly set the scale to 1 on some segstack prologue instrs.Rafael Espindola2012-01-111-3/+3
| | | | | | Patch by Brian Anderson. llvm-svn: 147952
* Fix undefined code and reenable test case.Jakob Stoklund Olesen2012-01-111-2/+2
| | | | | | | I don't think the compact encoding code is right, but at least is has defined behavior now. llvm-svn: 147938
* The saved registers weren't being processed in the correct order. This lead toBill Wendling2011-12-141-11/+14
| | | | | | | | the compact unwind claiming that one register was saved before another, which isn't all that great in general. Process them in the natural order. Reverse the list only when necessary for the algorithm. llvm-svn: 146612
* Adjust the stack by one pointer size for all frameless stacks.Bill Wendling2011-12-071-1/+2
| | | | llvm-svn: 146030
* Fix off-by-one error when encoding the stack size for a frameless stack.Bill Wendling2011-12-071-1/+1
| | | | llvm-svn: 146029
* Add bundle aware API for querying instruction properties and switch the codeEvan Cheng2011-12-071-1/+1
| | | | | | | | | | | | | | generator to it. For non-bundle instructions, these behave exactly the same as the MC layer API. For properties like mayLoad / mayStore, look into the bundle and if any of the bundled instructions has the property it would return true. For properties like isPredicable, only return true if *all* of the bundled instructions have the property. For properties like canFoldAsLoad, isCompare, conservatively return false for bundles. llvm-svn: 146026
* Explicitly check for the different SUB instructions.Bill Wendling2011-12-061-5/+2
| | | | llvm-svn: 145976
* Encode the total stack if there isn't a frame.Bill Wendling2011-12-061-2/+3
| | | | llvm-svn: 145969
* * Add a macro to remove a magic number.Bill Wendling2011-12-061-30/+35
| | | | | | * Rename variables to reflect what they're actually used for. llvm-svn: 145968
* Check the correct value for small stack sizes. Also modify some comments.Bill Wendling2011-12-061-5/+8
| | | | llvm-svn: 145954
* For a small sized stack, we encode that value directly with no "stack ↵Bill Wendling2011-12-061-1/+3
| | | | | | adjust" value. llvm-svn: 145952
* Add a comment.Bill Wendling2011-12-061-0/+3
| | | | llvm-svn: 145896
* The compact encoding of the registers are 3-bits each. Make sure we shift theBill Wendling2011-12-061-2/+4
| | | | | | value over that much. llvm-svn: 145888
* Check for stack space more intelligently.Sanjoy Das2011-12-031-4/+16
| | | | | | | | | libgcc sets the stack limit field in TCB to 256 bytes above the actual allocated stack limit. This means if the function's stack frame needs less than 256 bytes, we can just compare the stack pointer with the stack limit. This should result in lesser calls to __morestack. llvm-svn: 145766
* Fix a bug in the x86-32 code generated for segmented stacks.Sanjoy Das2011-12-031-8/+0
| | | | | | | | | | Currently LLVM pads the call to __morestack with a add and sub of 8 bytes to esp. This isn't correct since __morestack expects the call to be followed directly by a ret. This commit also adjusts the relevant test-case. llvm-svn: 145765
* Move global variables in TargetMachine into new TargetOptions class. As an APINick Lewycky2011-12-021-5/+5
| | | | | | | | | | | | change, now you need a TargetOptions object to create a TargetMachine. Clang patch to follow. One small functionality change in PTX. PTX had commented out the machine verifier parts in their copy of printAndVerify. That now calls the version in LLVMTargetMachine. Users of PTX who need verification disabled should rely on not passing the command-line flag to enable it. llvm-svn: 145714
* Dummy commit to check commit access.Sanjoy Das2011-12-011-1/+1
| | | | llvm-svn: 145619
* If we have to reset the calculation of the compact encoding, then also reset theBill Wendling2011-11-111-0/+1
| | | | | | | "saved register" index. <rdar://problem/10430076> llvm-svn: 144350
* This commit introduces two fake instructions MORESTACK_RET andRafael Espindola2011-10-261-21/+5
| | | | | | | | | | | | MORESTACK_RET_RESTORE_R10; which are lowered to a RET and a RET followed by a MOV respectively. Having a fake instruction prevents the verifier from seeing a MachineBasicBlock end with a non-terminator (MOV). It also prevents the rather eccentric case of a MachineBasicBlock ending with RET but having successors nevertheless. Patch by Sanjoy Das. llvm-svn: 143062
* Fix a bunch of unused variable warnings when doing a releaseDuncan Sands2011-10-181-4/+2
| | | | | | build with gcc-4.6. llvm-svn: 142350
* More closely follow libgcc, which has code after the `ret' instruction toBill Wendling2011-10-131-5/+24
| | | | | | | release the stack segment and reset the stack pointer. Place the code in its own MBB to make the verifier happy. llvm-svn: 141859
* Should not add instructions to a BB after a return instruction. The machine ↵Bill Wendling2011-10-131-1/+2
| | | | | | instruction verifier doesn't like this, nor do I. llvm-svn: 141856
* Only run MF.verify() with EXPENSIVE_CHECKS=1.Jakob Stoklund Olesen2011-09-241-1/+1
| | | | llvm-svn: 140441
OpenPOWER on IntegriCloud