summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
AgeCommit message (Collapse)Author
2008-07-17Re-introduce LeakDetector support for MachineInstrs and MachineBasicBlocks.Dan Gohman
Fix a leak that this turned up in LowerSubregs.cpp. And, comment a leak in LiveIntervalAnalysis.cpp. llvm-svn: 53746
2008-07-16Add an assert to check for empty flags for MachineMemOperand.Dan Gohman
llvm-svn: 53680
2008-07-11Trim unnecessary #includes.Dan Gohman
llvm-svn: 53471
2008-07-10- Change the horrible N^2 isRegReDefinedByTwoAddr. Now callers must supply ↵Evan Cheng
the operand index of def machineoperand and at most one full scan of non-implicit operands is needed. - Change local register allocator to use the new isRegReDefinedByTwoAddr instead of reinventing the wheel. llvm-svn: 53394
2008-07-08It's no longer necessary to test if a MachineBasicBlock'sDan Gohman
parent is non-null. It now always is. llvm-svn: 53263
2008-07-08Verify that MachineMemOperand alignment is a non-zero power of 2.Dan Gohman
llvm-svn: 53262
2008-07-07Pool-allocation for MachineInstrs, MachineBasicBlocks, andDan Gohman
MachineMemOperands. The pools are owned by MachineFunctions. This drastically reduces the number of calls to malloc/free made during the "Emit" phase of scheduling, as well as later phases in CodeGen. Combined with other changes, this speeds up the "instruction selection" phase of CodeGen by 10% in some cases. llvm-svn: 53212
2008-07-07Move MachineMemOperand's constructor out of line, to avoid aDan Gohman
#include dependency on Support/MathExtras.h in the header file. llvm-svn: 53200
2008-07-03- Remove calls to copyKillDeadInfo which is an N^2 function. Instead, ↵Evan Cheng
propagate kill / dead markers as new instructions are constructed in foldMemoryOperand, convertToThressAddress, etc. - Also remove LiveVariables::instructionChanged, etc. Replace all calls with cheaper calls which update VarInfo kill list. llvm-svn: 53097
2008-07-03Reapply r52988, "Simplify addRegisterKilled and addRegisterDead." TheDan Gohman
254.gap failure was not due to this mod. llvm-svn: 53068
2008-07-02Revert r52988. It broke 254.gap on x86-64.Dan Gohman
llvm-svn: 53050
2008-07-01Simplify addRegisterKilled and addRegisterDead.Evan Cheng
llvm-svn: 52988
2008-07-01Split ISD::LABEL into ISD::DBG_LABEL and ISD::EH_LABEL, eliminatingDan Gohman
the need for a flavor operand, and add a new SDNode subclass, LabelSDNode, for use with them to eliminate the need for a label id operand. Change instruction selection to let these label nodes through unmodified instead of creating copies of them. Teach the MachineInstr emitter how to emit a MachineInstr directly from an ISD label node. This avoids the need for allocating SDNodes for the label id and flavor value, as well as SDNodes for each of the post-isel label, label id, and label flavor. llvm-svn: 52943
2008-06-27Looks like this condition is inverted.Evan Cheng
llvm-svn: 52841
2008-06-27Don't perform expensive queries checking for super and sub registers when we ↵Owen Anderson
know that there aren't any. This speed up LiveVariables on instcombine at -O0 -g from 0.3855s to 0.3503s. Look for more improvements in this area soon! llvm-svn: 52804
2008-05-28Add a flag to indicate that an instruction is as cheap (or cheaper) than a moveBill Wendling
instruction to execute. This can be used for transformations (like two-address conversion) to remat an instruction instead of generating a "move" instruction. The idea is to decrease the live ranges and register pressure and all that jazz. llvm-svn: 51660
2008-05-06Fix a broken doxygen comment, and reword it for clarity.Dan Gohman
llvm-svn: 50687
2008-04-16Code clean up.Evan Cheng
llvm-svn: 49783
2008-04-07Rename MemOperand to MachineMemOperand. This was suggested byDan Gohman
review feedback from Chris quite a while ago. No functionality change. llvm-svn: 49348
2008-03-20detabify llvm, patch by Mike Stump!Chris Lattner
llvm-svn: 48577
2008-03-13Refactor some code out of MachineSink into a MachineInstr query.Evan Cheng
llvm-svn: 48311
2008-03-05Refactor code. Remove duplicated functions that basically do the same thing asEvan Cheng
findRegisterUseOperandIdx, findRegisterDefOperandIndx. Fix some naming inconsistencies. llvm-svn: 47927
2008-03-04Did I say 'e = getNumOperands()'? I meant --e, of course.Bill Wendling
llvm-svn: 47875
2008-03-03Miscellaneous clean-ups based on Evan's feedback:Bill Wendling
- 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. llvm-svn: 47870
2008-03-03Go through the machine instruction's operands to make sure that we're notBill Wendling
marking both a super- and sub-register as "killed". This removes implicit uses that are marked as "killed". llvm-svn: 47862
2008-02-26Rename PrintableName to Name.Bill Wendling
llvm-svn: 47629
2008-02-24Some platforms use the same name for 32-bit and 64-bit registers (likeBill Wendling
%r3 on PPC) in their ASM files. However, it's hard for humans to read during debugging. Adding a new field to the register data that lets you specify a different name to be printed than the one that goes into the ASM file -- %x3 instead of %r3, for instance. llvm-svn: 47534
2008-02-14Support a new type of MachineOperand, MO_FPImmediate, used for holdingNate Begeman
FP Immediates, crazily enough llvm-svn: 47117
2008-02-10Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman
llvm-svn: 46930
2008-02-08Also print alignment.Evan Cheng
llvm-svn: 46895
2008-02-07Don't abort if a MemOperand is missing a SourceValue; just print itDan Gohman
as <unknown>. And make some minor adjustments to the MemOperand dump format. llvm-svn: 46853
2008-02-06Re-apply the memory operand changes, with a fix for the staticDan Gohman
initializer problem, a minor tweak to the way the DAGISelEmitter finds load/store nodes, and a renaming of the new PseudoSourceValue objects. llvm-svn: 46827
2008-01-31Revert 46556 and 46585. Dan please fix the PseudoSourceValue problem and ↵Evan Cheng
re-commit. llvm-svn: 46623
2008-01-31Add an extra operand to LABEL nodes which distinguishes between debug, EH, ↵Evan Cheng
or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution. llvm-svn: 46609
2008-01-31Create a new class, MemOperand, for describing memory referencesDan Gohman
in the backend. Introduce a new SDNode type, MemOperandSDNode, for holding a MemOperand in the SelectionDAG IR, and add a MemOperand list to MachineInstr, and code to manage them. Remove the offset field from SrcValueSDNode; uses of SrcValueSDNode that were using it are all all using MemOperandSDNode now. Also, begin updating some getLoad and getStore calls to use the PseudoSourceValue objects. Most of this was written by Florian Brander, some reorganization and updating to TOT by me. llvm-svn: 46585
2008-01-24Move some functionality for adding flags to MachineInstr's into methods on ↵Owen Anderson
MachineInstr rather than LiveVariables. llvm-svn: 46295
2008-01-07remove #includageChris Lattner
llvm-svn: 45697
2008-01-07rename TargetInstrDescriptor -> TargetInstrDesc.Chris Lattner
Make MachineInstr::getDesc return a reference instead of a pointer, since it can never be null. llvm-svn: 45695
2008-01-07rename hasVariableOperands() -> isVariadic(). Add some comments.Chris Lattner
Evan, please review the comments I added to getNumDefs to make sure that they are accurate, thx. llvm-svn: 45687
2008-01-07Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptorChris Lattner
llvm-svn: 45680
2008-01-07Add predicates methods to TargetOperandInfo, and switch all clients Chris Lattner
over to using them, instead of diddling Flags directly. Change the various flags from const variables to enums. llvm-svn: 45677
2008-01-07Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflectsChris Lattner
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
2008-01-01Make MachineRegisterInfo::getVRegDef more efficient by aiming the keep the ↵Chris Lattner
def of the vreg at the start of the list, so the list doesn't need to be traversed. llvm-svn: 45483
2008-01-01switch the register iterator to act more like hte LLVM value iterator: ↵Chris Lattner
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
2008-01-01Implement automatically updated def/use lists for all MachineInstr register Chris Lattner
operands. The lists are currently kept in MachineRegisterInfo, but it does not yet provide an iterator interface to them. llvm-svn: 45477
2007-12-31properly encapsulate the parent field of MBB and MI with get/set accessors.Chris Lattner
llvm-svn: 45469
2007-12-31Rename SSARegMap -> MachineRegisterInfo in keeping with the idea Chris Lattner
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
2007-12-30Add new shorter predicates for testing machine operands for various types: Chris Lattner
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
2007-12-30More cleanups for MachineOperand:Chris Lattner
- 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
2007-12-30MachineOperand:Chris Lattner
- 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