summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86RegisterInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-1/+1
| | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
* Add register-reuse to frame-index register scavenging. When a target usesJim Grosbach2009-10-071-2/+5
| | | | | | | | | | | | | | | | | | | | a virtual register to eliminate a frame index, it can return that register and the constant stored there to PEI to track. When scavenging to allocate for those registers, PEI then tracks the last-used register and value, and if it is still available and matches the value for the next index, reuses the existing value rather and removes the re-materialization instructions. Fancier tracking and adjustment of scavenger allocations to keep more values live for longer is possible, but not yet implemented and would likely be better done via a different, less special-purpose, approach to the problem. eliminateFrameIndex() is modified so the target implementations can return the registers they wish to be tracked for reuse. ARM Thumb1 implements and utilizes the new mechanism. All other targets are simply modified to adjust for the changed eliminateFrameIndex() prototype. llvm-svn: 83467
* Mark more constants unsigned, as warned about by icc (#68).Duncan Sands2009-09-061-1/+1
| | | | | | Patch by Erick Tryzelaar. llvm-svn: 81116
* If we've pushed registers onto the stack, but aren't adjusting the stack pointerBill Wendling2009-09-031-2/+2
| | | | | | | (i.e., there are no local variables and stuff), we still need to output FDE information for the pushed registers. llvm-svn: 80960
* Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.Chris Lattner2009-08-221-1/+1
| | | | llvm-svn: 79763
* Styalistic and format changes. No functionality change.Bill Wendling2009-08-161-73/+85
| | | | llvm-svn: 79187
* An overhaul of the exception handling code. This is arguably more correct thanBill Wendling2009-08-151-55/+81
| | | | | | | | | | | | | what was there before. In "no FP mode", we weren't generating labels and unwind table entries after each "push" instruction. While more than likely "okay", it's not technically correct. The major thing was that the ordering of when to define a new CFA register and at what offset wasn't correct. This would cause the exception handling to fail in ways most miserable to users. I also cleaned up some code a bit. There's one function which has a "return" at the beginning, so it's never used. Should I just remove it? :-) llvm-svn: 79139
* Split EVT into MVT and EVT, the former representing _just_ a primitive type, ↵Owen Anderson2009-08-111-5/+5
| | | | | | | | while the latter is capable of representing either a primitive or an extended type. llvm-svn: 78713
* Rename MVT to EVT, in preparation for splitting SimpleValueType out into its ↵Owen Anderson2009-08-101-5/+5
| | | | | | own struct type. llvm-svn: 78610
* Enable the new no-SP register classes by default. This is to addressDan Gohman2009-08-051-14/+3
| | | | | | | PR4572. A few tests have some minor code regressions due to different coalescing. llvm-svn: 78217
* Create proper frame index for FPAnton Korobeynikov2009-08-031-1/+3
| | | | llvm-svn: 77966
* Unbreak Win64 CC. Step one: honour register save area, fix some alignment ↵Anton Korobeynikov2009-08-031-14/+22
| | | | | | and provide a different set of call-clobberred registers. llvm-svn: 77962
* The x86 jit doesn't generate a def_cfa_offset unwind instruction after theBill Wendling2009-08-021-1/+1
| | | | | | | | | | | | | pushes in the function prolog if the function doesn't have any stack space, i.e. for a prolog like: 0x40011870: push %r15 0x40011872: push %r14 0x40011874: push %rbx Patch by Zoltan! llvm-svn: 77919
* The X86 maximal stack alignment calculator preserves the CFG. Also,Dan Gohman2009-08-011-2/+9
| | | | | | be more careful about the return value of runOnMachineFunction. llvm-svn: 77758
* Add a new register class to describe operands that can't be SP,Dan Gohman2009-07-301-16/+50
| | | | | | | due to x86 encoding restrictions. This is currently off by default because it may cause code quality regressions. This is for PR4572. llvm-svn: 77565
* Give getPointerRegClass() a "kind" value so that targets can Chris Lattner2009-07-291-5/+4
| | | | | | support multiple different pointer register classes. llvm-svn: 77501
* Revert r75581: it causes massive breakage in the AdaDuncan Sands2009-07-231-0/+23
| | | | | | | | | | | | | | | | testsuite, due to exception handling not working correctly. Maybe because the libgcc unwinder is miscompiled - not sure, and I won't have time to look into it before leaving on holiday. Note that miscompilations of libgcc are not picked up by the nightly testers, because they dynamically link with libgcc, so pick up the system version rather than the version built as part of llvm-gcc. This is a nasty flaw in the nightly testers. (On the other hand the Ada testsuite links with the just built libgcc). llvm-svn: 76895
* Fix some sub-reg coalescing bugs where the coalescer wasn't updating the ↵Evan Cheng2009-07-201-22/+37
| | | | | | resulting interval's register class. llvm-svn: 76458
* Enable cross register class coalescing.Evan Cheng2009-07-181-0/+78
| | | | llvm-svn: 76281
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-4/+4
| | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
* Remove hack now that Evan fixed it so that the frame pointer isn't saved twice.Bill Wendling2009-07-141-23/+0
| | | | llvm-svn: 75581
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-4/+5
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
* If -fomit-frame-pointer is used, we still need to record when the %esp registerBill Wendling2009-07-091-1/+20
| | | | | | | | | | | | | is modified. Otherwise, the unwinder will get confused. The old code (before I started my hacking) did this. It dropped on the floor, because I wasn't aware of this requirement. On the plus side, if we use "alloca" in a function, we create frame pointers even with -fomit-frame-pointer is enabled! This is a Good Thing(tm)!!! llvm-svn: 75183
* Targets sometimes assign fixed stack object to spill certain callee-savedEvan Cheng2009-07-091-3/+10
| | | | | | | | | | 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
* Recommit r74952 with a bug fix:Bill Wendling2009-07-081-68/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DWARF requires frame moves be specified at specific times. If you have a prologue like this: __Z3fooi: Leh_func_begin1: LBB1_0: ## entry pushl %ebp Llabel1: movl %esp, %ebp Llabel2: pushl %esi Llabel3: subl $20, %esp call "L1$pb" "L1$pb": popl %esi The "pushl %ebp" needs a table entry specifying the offset. The "movl %esp, %ebp" makes %ebp the new stack frame register, so that needs to be specified in DWARF. And "pushl %esi" saves the callee-saved %esi register, which also needs to be specified in DWARF. Before, all of this logic was in one method. This didn't work too well, because as you can see there are multiple FDE line entries that need to be created. This fix creates the "MachineMove" objects directly when they're needed; instead of waiting until the end, and losing information. There is some ugliness where we generate code like this: LBB22_0: ## entry pushl %ebp Llabel280: movl %esp, %ebp Llabel281: Llabel284: pushl %ebp <---------- pushl %ebx pushl %edi pushl %esi Llabel282: subl $328, %esp Notice the extra "pushl %ebp". If we generate a "machine move" instruction in the FDE for that pushl, the linker may get very confused about what value %ebp should have when exitting the function. I.e., it'll give it the value %esp instead of the %ebp value from the first "pushl". Not to mention that, in this case, %ebp isn't modified in the function (that's a separate bug). I put a small hack in to get it to work. It might be the only solution, but should be revisited once the above case is fixed. llvm-svn: 75047
* --- Reverse-merging (from foreign repository) r74952 into '.':Bill Wendling2009-07-071-76/+68
| | | | | | | | | U lib/Target/X86/X86RegisterInfo.cpp U lib/Target/X86/X86RegisterInfo.h Temporarily revert. This was causing an infinite loop in the linker on Leopard. llvm-svn: 74970
* DWARF requires frame moves be specified at specific times. If you have aBill Wendling2009-07-071-68/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prologue like this: __Z3fooi: Leh_func_begin1: LBB1_0: ## entry pushl %ebp Llabel1: movl %esp, %ebp Llabel2: pushl %esi Llabel3: subl $20, %esp call "L1$pb" "L1$pb": popl %esi The "pushl %ebp" needs a table entry specifying the offset. The "movl %esp, %ebp" makes %ebp the new stack frame register, so that needs to be specified in DWARF. And "pushl %esi" saves the callee-saved %esi register, which also needs to be specified in DWARF. Before, all of this logic was in one method. This didn't work too well, because as you can see there are multiple FDE line entries that need to be created. This fix creates the "MachineMove" objects directly when they're needed; instead of waiting until the end, and losing information. llvm-svn: 74952
* Do not use first actual instruction's location for prologue. The debug wants ↵Devang Patel2009-06-171-2/+1
| | | | | | to skip prologue while setting a breakpoint for the function. llvm-svn: 73592
* There doesn't seem to be a reason to move the save FP stuff.Bill Wendling2009-06-161-7/+7
| | | | llvm-svn: 73468
* The DWARF to compact encoding converter assumes that the DW_CFA_def_cfa_offsetBill Wendling2009-06-161-20/+18
| | | | | | | | | | | | | | | | | | | | | | | comes after the DW_CFA_def_cfa_register, because the CFA is really ESP from the start of the function and only gets an offset when the "subl $xxx,%esp" instruction happens, not the other way around. And reapply r72898: The DWARF unwind info was incorrect. While compiling with `-fomit-frame-pointer', we would lack the DW_CFA_advance_loc information for a lot of function, and then they would be `0'. The linker (at least on Darwin) needs to encode the stack size. In some cases, the stack size is too large to directly encode. So the linker checks to see if there is a "subl $xxx,%esp" instruction at the point where the `DW_CFA_def_cfa_offset' says the pc was. If so, the compact encoding records the offset in the function to where the stack size is embedded. But because the `DW_CFA_advance_loc' instructions are missing, it looks before the function and dies. So, instead of emitting the EH debug label before the stack adjustment operations, emit it afterwards, right before the frame move stuff. llvm-svn: 73465
* Simplified logic of this if-then statement to reduce nesting. No functionalityBill Wendling2009-06-091-44/+46
| | | | | | change. llvm-svn: 73143
* Revert r72898. It does not solve the problem I want it to solve.Bill Wendling2009-06-081-16/+15
| | | | llvm-svn: 73075
* The DWARF unwind info was incorrect. While compiling withBill Wendling2009-06-041-15/+16
| | | | | | | | | | | | | | | | `-fomit-frame-pointer', we would lack the DW_CFA_advance_loc information for a lot of function, and then they would be `0'. The linker (at least on Darwin) needs to encode the stack size. In some cases, the stack size is too large to directly encode. So the linker checks to see if there is a "subl $xxx,%esp" instruction at the point where the `DW_CFA_def_cfa_offset' says the pc was. If so, the compact encoding records the offset in the function to where the stack size is embedded. But because the `DW_CFA_advance_loc' instructions are missing, it looks before the function and dies. So, instead of emitting the EH debug label before the stack adjustment operations, emit it afterwards, right before the frame move stuff. llvm-svn: 72898
* Add new function attribute - noredzone. Devang Patel2009-06-041-0/+1
| | | | | | | Update code generator to use this attribute and remove DisableRedZone target option. Update llc to set this attribute when -disable-red-zone command line option is used. llvm-svn: 72894
* PR3739, part 1: Disable the red zone on Win64.Eli Friedman2009-06-041-1/+2
| | | | llvm-svn: 72830
* Change MachineInstrBuilder::addReg() to take a flag instead of a list ofBill Wendling2009-05-131-2/+2
| | | | | | | | | | | | booleans. This gives a better indication of what the "addReg()" is doing. Remembering what all of those booleans mean isn't easy, especially if you aren't spending all of your time in that code. I took Jakob's suggestion and made it illegal to pass in "true" for the flag. This should hopefully prevent any unintended misuse of this (by reverting to the old way of using addReg()). llvm-svn: 71722
* Re-apply 68552.Rafael Espindola2009-04-081-2/+2
| | | | | | Tested by bootstrapping llvm-gcc and using that to build llvm. llvm-svn: 68645
* Temporarily revert r68552. This was causing a failure in the self-hosting LLVMBill Wendling2009-04-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | builds. --- Reverse-merging (from foreign repository) r68552 into '.': U test/CodeGen/X86/tls8.ll U test/CodeGen/X86/tls10.ll U test/CodeGen/X86/tls2.ll U test/CodeGen/X86/tls6.ll U lib/Target/X86/X86Instr64bit.td U lib/Target/X86/X86InstrSSE.td U lib/Target/X86/X86InstrInfo.td U lib/Target/X86/X86RegisterInfo.cpp U lib/Target/X86/X86ISelLowering.cpp U lib/Target/X86/X86CodeEmitter.cpp U lib/Target/X86/X86FastISel.cpp U lib/Target/X86/X86InstrInfo.h U lib/Target/X86/X86ISelDAGToDAG.cpp U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h U lib/Target/X86/X86ISelLowering.h U lib/Target/X86/X86InstrInfo.cpp U lib/Target/X86/X86InstrBuilder.h U lib/Target/X86/X86RegisterInfo.td llvm-svn: 68560
* Reduce code duplication on the TLS implementation.Rafael Espindola2009-04-071-2/+2
| | | | | | | | | | This introduces a small regression on the generated code quality in the case we are just computing addresses, not loading values. Will work on it and on X86-64 support. llvm-svn: 68552
* Remove strange extra semicolons.Nick Lewycky2009-03-191-1/+1
| | | | llvm-svn: 67287
* Make sure this doesn't access .end() too.Bill Wendling2009-02-211-3/+4
| | | | llvm-svn: 65213
* Make sure we don't dereference the .end() of the container.Bill Wendling2009-02-211-1/+2
| | | | llvm-svn: 65211
* Propagate more debug loc infos. This also includes some code cleaning.Bill Wendling2009-02-211-6/+18
| | | | llvm-svn: 65207
* We need to propagate the debug location information even when dealing with theBill Wendling2009-02-211-4/+4
| | | | | | prologue/epilogue. llvm-svn: 65206
* Remove non-DebugLoc versions of BuildMI from X86.Dale Johannesen2009-02-131-1/+4
| | | | | | There were some that might even matter in X86FastISel. llvm-svn: 64437
* Revert this. It was breaking stuff.Bill Wendling2009-02-131-1/+9
| | | | llvm-svn: 64428
* Turn off the old way of handling debug information in the code generator. UseBill Wendling2009-02-131-9/+1
| | | | | | | the new way, where all of the information is passed on SDNodes and machine instructions. llvm-svn: 64427
* Eliminate a couple of non-DebugLoc BuildMI variants.Dale Johannesen2009-02-121-24/+33
| | | | | | Modify callers. llvm-svn: 64409
* Don't try to set an EFLAGS operand to dead if no instruction was created.Dan Gohman2009-02-111-4/+6
| | | | | | This fixes a bug introduced by r61215. llvm-svn: 64316
* Move getPointerRegClass from TargetInstrInfo to TargetRegisterInfo.Evan Cheng2009-02-061-0/+8
| | | | llvm-svn: 63938
OpenPOWER on IntegriCloud