summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* simplify some code using new predicatesChris Lattner2008-01-072-24/+21
| | | | llvm-svn: 45689
* rename hasVariableOperands() -> isVariadic(). Add some comments.Chris Lattner2008-01-072-5/+4
| | | | | | | Evan, please review the comments I added to getNumDefs to make sure that they are accurate, thx. llvm-svn: 45687
* Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptorChris Lattner2008-01-078-44/+44
| | | | llvm-svn: 45680
* remove some uses of MachineOpCode, move getSchedClass Chris Lattner2008-01-071-2/+3
| | | | | | into TargetInstrDescriptor from TargetInstrInfo. llvm-svn: 45678
* Add predicates methods to TargetOperandInfo, and switch all clients Chris Lattner2008-01-073-7/+7
| | | | | | | over to using them, instead of diddling Flags directly. Change the various flags from const variables to enums. llvm-svn: 45677
* Setting GlobalDirective in TargetAsmInfo by default rather thanGordon Henriksen2008-01-071-0/+177
| | | | | | | providing a misleading facility. It's used once in the MIPS backend and hardcoded as "\t.globl\t" everywhere else. llvm-svn: 45676
* Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflectsChris Lattner2008-01-0715-68/+57
| | | | | | | | | | | | | | | 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
* Update CodeGen for MRegisterInfo --> TargetInstrInfo changes.Owen Anderson2008-01-075-12/+14
| | | | llvm-svn: 45673
* Ammending r45669 with a missing file.Gordon Henriksen2008-01-071-4/+23
| | | | llvm-svn: 45671
* With this patch, the LowerGC transformation becomes theGordon Henriksen2008-01-071-0/+441
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ShadowStackCollector, which additionally has reduced overhead with no sacrifice in portability. Considering a function @fun with 8 loop-local roots, ShadowStackCollector introduces the following overhead (x86): ; shadowstack prologue movl L_llvm_gc_root_chain$non_lazy_ptr, %eax movl (%eax), %ecx movl $___gc_fun, 20(%esp) movl $0, 24(%esp) movl $0, 28(%esp) movl $0, 32(%esp) movl $0, 36(%esp) movl $0, 40(%esp) movl $0, 44(%esp) movl $0, 48(%esp) movl $0, 52(%esp) movl %ecx, 16(%esp) leal 16(%esp), %ecx movl %ecx, (%eax) ; shadowstack loop overhead (none) ; shadowstack epilogue movl 48(%esp), %edx movl %edx, (%ecx) ; shadowstack metadata .align 3 ___gc_fun: # __gc_fun .long 8 .space 4 In comparison to LowerGC: ; lowergc prologue movl L_llvm_gc_root_chain$non_lazy_ptr, %eax movl (%eax), %ecx movl %ecx, 48(%esp) movl $8, 52(%esp) movl $0, 60(%esp) movl $0, 56(%esp) movl $0, 68(%esp) movl $0, 64(%esp) movl $0, 76(%esp) movl $0, 72(%esp) movl $0, 84(%esp) movl $0, 80(%esp) movl $0, 92(%esp) movl $0, 88(%esp) movl $0, 100(%esp) movl $0, 96(%esp) movl $0, 108(%esp) movl $0, 104(%esp) movl $0, 116(%esp) movl $0, 112(%esp) ; lowergc loop overhead leal 44(%esp), %eax movl %eax, 56(%esp) leal 40(%esp), %eax movl %eax, 64(%esp) leal 36(%esp), %eax movl %eax, 72(%esp) leal 32(%esp), %eax movl %eax, 80(%esp) leal 28(%esp), %eax movl %eax, 88(%esp) leal 24(%esp), %eax movl %eax, 96(%esp) leal 20(%esp), %eax movl %eax, 104(%esp) leal 16(%esp), %eax movl %eax, 112(%esp) ; lowergc epilogue movl 48(%esp), %edx movl %edx, (%ecx) ; lowergc metadata (none) llvm-svn: 45670
* Enabling the target-independent garbage collection infrastructure by hooking itGordon Henriksen2008-01-073-8/+58
| | | | | | | | | up to the various compiler pipelines. This doesn't actually add support for any GC algorithms, which means it temporarily breaks a few tests. To be fixed shortly. llvm-svn: 45669
* rename isLoad -> isSimpleLoad due to evan's desire to have such a predicate.Chris Lattner2008-01-062-6/+5
| | | | llvm-svn: 45667
* rename isStore -> mayStore to more accurately reflect what it captures.Chris Lattner2008-01-061-1/+1
| | | | llvm-svn: 45656
* Remove an unused variable.Duncan Sands2008-01-061-1/+0
| | | | llvm-svn: 45655
* make this build with newer gcc'sChris Lattner2008-01-051-2/+1
| | | | llvm-svn: 45637
* If custom lowering of insert element fails, the result Val will be 0.Nate Begeman2008-01-051-3/+3
| | | | | | | Don't overwrite a variable used by the fallthrough code path in this case. llvm-svn: 45630
* Fix build issue on certain compilers.Chris Lattner2008-01-051-1/+2
| | | | llvm-svn: 45629
* The current impl is really trivial, add some comments about how it can be ↵Chris Lattner2008-01-051-2/+24
| | | | | | made better. llvm-svn: 45625
* allow sinking to be enabled for the jitChris Lattner2008-01-051-0/+3
| | | | llvm-svn: 45624
* don't sink anything with side effects, this makes lots of stuff work, but ↵Chris Lattner2008-01-051-0/+4
| | | | | | sinks almost nothing. llvm-svn: 45617
* fix a common crash.Chris Lattner2008-01-051-0/+4
| | | | llvm-svn: 45614
* I should not be allowed to commit when sleepy.Owen Anderson2008-01-051-2/+2
| | | | llvm-svn: 45608
* Don't recalculate the loop info and loop dominators analyses if they'reBill Wendling2008-01-047-6/+26
| | | | | | preserved. llvm-svn: 45596
* 80-column violations.Bill Wendling2008-01-041-10/+14
| | | | llvm-svn: 45574
* Add that this preserves some analyses.Bill Wendling2008-01-041-1/+3
| | | | llvm-svn: 45573
* Move option to enable machine LICM into LLVMTargetMachine.cpp.Bill Wendling2008-01-042-13/+8
| | | | llvm-svn: 45572
* Call the parent's getAnalysisUsage.Bill Wendling2008-01-041-0/+1
| | | | llvm-svn: 45571
* Add a really quick hack at a machine code sinking pass, enabled with ↵Chris Lattner2008-01-042-0/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --enable-sinking. It is missing validity checks, so it is known broken. However, it is powerful enough to compile this contrived code: void test1(int C, double A, double B, double *P) { double Tmp = A*A+B*B; *P = C ? Tmp : A; } into: _test1: movsd 8(%esp), %xmm0 cmpl $0, 4(%esp) je LBB1_2 # entry LBB1_1: # entry movsd 16(%esp), %xmm1 mulsd %xmm1, %xmm1 mulsd %xmm0, %xmm0 addsd %xmm1, %xmm0 LBB1_2: # entry movl 24(%esp), %eax movsd %xmm0, (%eax) ret instead of: _test1: movsd 16(%esp), %xmm0 mulsd %xmm0, %xmm0 movsd 8(%esp), %xmm1 movapd %xmm1, %xmm2 mulsd %xmm2, %xmm2 addsd %xmm0, %xmm2 cmpl $0, 4(%esp) je LBB1_2 # entry LBB1_1: # entry movapd %xmm2, %xmm1 LBB1_2: # entry movl 24(%esp), %eax movsd %xmm1, (%eax) ret woo. llvm-svn: 45570
* remove dead #includes and reorder the rest.Chris Lattner2008-01-041-10/+6
| | | | llvm-svn: 45569
* Use the correct MachineRegisterInfo object.Bill Wendling2008-01-021-2/+1
| | | | llvm-svn: 45499
* Remove dead code.Bill Wendling2008-01-021-35/+0
| | | | llvm-svn: 45496
* Use the new architecture to get the containing machine basic block for a machineBill Wendling2008-01-021-28/+28
| | | | | | | instruction. Also, use "splice" to move the new instruction instead of remove/insert (where it was leaking memory anyway). llvm-svn: 45492
* Move some more instruction creation methods from RegisterInfo into InstrInfo.Owen Anderson2008-01-016-21/+36
| | | | llvm-svn: 45484
* Make MachineRegisterInfo::getVRegDef more efficient by aiming the keep the ↵Chris Lattner2008-01-011-4/+10
| | | | | | def of the vreg at the start of the list, so the list doesn't need to be traversed. llvm-svn: 45483
* switch the register iterator to act more like hte LLVM value iterator: ↵Chris Lattner2008-01-012-3/+17
| | | | | | | | | | | dereferencing it now returns the machineinstr of the use. To get the operand, use I.getOperand(). Add a new MachineRegisterInfo::replaceRegWith, which is basically like Value::replaceAllUsesWith. llvm-svn: 45482
* Add a trivial but handy function to efficiently return the machine Chris Lattner2008-01-011-0/+15
| | | | | | instruction that defines the specified vreg. Crazy. llvm-svn: 45480
* Implement automatically updated def/use lists for all MachineInstr register Chris Lattner2008-01-013-8/+331
| | | | | | | operands. The lists are currently kept in MachineRegisterInfo, but it does not yet provide an iterator interface to them. llvm-svn: 45477
* Fix a problem where lib/Target/TargetInstrInfo.h would include and useChris Lattner2008-01-011-0/+58
| | | | | | | | | | a header file from libcodegen. This violates a layering order: codegen depends on target, not the other way around. The fix to this is to split TII into two classes, TII and TargetInstrInfoImpl, which defines stuff that depends on libcodegen. It is defined in libcodegen, where the base is not. llvm-svn: 45475
* Fix PR1833 - eh.exception and eh.selector return twoDuncan Sands2007-12-311-6/+28
| | | | | | | | values, which means doing extra legalization work. It would be easier to get this kind of thing right if there was some documentation... llvm-svn: 45472
* Move copyRegToReg from MRegisterInfo to TargetInstrInfo. This is part of theOwen Anderson2007-12-315-17/+18
| | | | | | Machine-level API cleanup instigated by Chris. llvm-svn: 45470
* properly encapsulate the parent field of MBB and MI with get/set accessors.Chris Lattner2007-12-313-31/+35
| | | | llvm-svn: 45469
* update a couple of references to SSARegMap.Chris Lattner2007-12-312-3/+3
| | | | llvm-svn: 45468
* Rename SSARegMap -> MachineRegisterInfo in keeping with the idea Chris Lattner2007-12-3123-200/+224
| | | | | | | | | | | | | | 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. llvm-svn: 45467
* Add new shorter predicates for testing machine operands for various types: Chris Lattner2007-12-307-29/+23
| | | | | | | | | | | | e.g. MO.isMBB() instead of MO.isMachineBasicBlock(). I don't plan on switching everything over, so new clients should just start using the shorter names. Remove old long accessors, switching everything over to use the short accessor: getMachineBasicBlock() -> getMBB(), getConstantPoolIndex() -> getIndex(), setMachineBasicBlock -> setMBB(), etc. llvm-svn: 45464
* More cleanups for MachineOperand:Chris Lattner2007-12-305-122/+126
| | | | | | | | | | - Eliminate the static "print" method for operands, moving it into MachineOperand::print. - Change various set* methods for register flags to take a bool for the value to set it to. Remove unset* methods. - Group methods more logically by operand flavor in MachineOperand.h llvm-svn: 45461
* MachineOperand:Chris Lattner2007-12-301-57/+38
| | | | | | | | | | | | | | | | | - Add getParent() accessors. - Move SubReg out of the AuxInfo union, to make way for future changes. - Remove the getImmedValue/setImmedValue methods. - in some MachineOperand::Create* methods, stop initializing fields that are dead. MachineInstr: - Delete one copy of the MachineInstr printing code, now there is only one dump format and one copy of the code. - Make MachineOperand use the parent field to get info about preg register names if no target info is otherwise available. - Move def/use/kill/dead flag printing to the machineoperand printer, so they are always printed for an operand. llvm-svn: 45460
* fix typo duncan noticed!Chris Lattner2007-12-301-1/+1
| | | | llvm-svn: 45459
* simpilfy some register printing code.Chris Lattner2007-12-301-16/+6
| | | | llvm-svn: 45458
* eliminate a copy of the machineoperand printing stuff. Keep the copy thatChris Lattner2007-12-301-34/+4
| | | | | | knows how to print offsets. llvm-svn: 45457
* Simplify and clean up some machine operand/instr printing/dumping stuff.Chris Lattner2007-12-301-9/+9
| | | | llvm-svn: 45456
OpenPOWER on IntegriCloud