aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/MachineInstrBuilder.h
Commit message (Collapse)AuthorAgeFilesLines
* Update aosp/master llvm for rebase to r233350Pirama Arumuga Nainar2015-04-091-2/+2
| | | | Change-Id: I07d935f8793ee8ec6b7da003f6483046594bca49
* Update aosp/master LLVM for rebase to r222494.Stephen Hines2014-12-021-21/+28
| | | | Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
* Update LLVM for 3.5 rebase (r209712).Stephen Hines2014-05-291-1/+1
| | | | Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
* Update to LLVM 3.5a.Stephen Hines2014-04-241-1/+6
| | | | Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
* Reapply an improved version of r180816/180817.Adrian Prantl2013-07-091-0/+45
| | | | | | | | | | | | | | | Change the informal convention of DBG_VALUE machine instructions so that we can express a register-indirect address with an offset of 0. The old convention was that a DBG_VALUE is a register-indirect value if the offset (operand 1) is nonzero. The new convention is that a DBG_VALUE is register-indirect if the first operand is a register and the second operand is an immediate. For plain register values the combination reg, reg is used. MachineInstrBuilder::BuildMI knows how to build the new DBG_VALUES. rdar://problem/13658587 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185966 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert "Change the informal convention of DBG_VALUE so that we ↵Adrian Prantl2013-04-301-45/+0
| | | | | | | | | | can express a" because it breaks some buildbots. This reverts commit 180816. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180819 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the informal convention of DBG_VALUE so that we can express aAdrian Prantl2013-04-301-0/+45
| | | | | | | | | | | | register-indirect address with an offset of 0. It used to be that a DBG_VALUE is a register-indirect value if the offset (operand 1) is nonzero. The new convention is that a DBG_VALUE is register-indirect if the first operand is a register and the second operand is an immediate. For plain registers use the combination reg, reg. rdar://problem/13658587 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180816 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a getBundleEnd() function to go with the existing getBundleStart().Jakob Stoklund Olesen2013-01-091-5/+2
| | | | | | This is easier implemented now that bundle flags are symmetric. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171927 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an MF argument to MI::copyImplicitOps().Jakob Stoklund Olesen2012-12-201-0/+6
| | | | | | | | | This function is often used to decorate dangling instructions, so a context reference is required to allocate memory for the operands. Also add a corresponding MachineInstrBuilder method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170797 91177308-0d34-0410-b5e6-96231b3b80d8
* Use MachineInstrBuilder in InstrEmitter.Jakob Stoklund Olesen2012-12-201-0/+10
| | | | | | | | | | | | This is supposed to be a mechanical change with no functional effects. InstrEmitter can generate all types of MachineOperands which revealed that MachineInstrBuilder was missing a few methods, added by this patch. Besides providing a context pointer to MI::addOperand(), MachineInstrBuilder seems like a better fit for this code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170712 91177308-0d34-0410-b5e6-96231b3b80d8
* Always use addOperand(MF, MO) from MachineInstrBuilder.Jakob Stoklund Olesen2012-12-191-25/+26
| | | | | | The single-argument MachineInstr::addOperand(MO) will be removed soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170599 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the explicit MachineInstrBuilder(MI) constructor.Jakob Stoklund Olesen2012-12-191-1/+0
| | | | | | | | | | | | | Use the version that also takes an MF reference instead. It would technically be possible to extract an MF reference from the MI as MI->getParent()->getParent(), but that would not work for MIs that are not inserted into any basic block. Given the reasonably small number of places this constructor was used at all, I preferred the compile time check to a run time assertion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170588 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an MF argument to MachineInstr::addOperand().Jakob Stoklund Olesen2012-12-191-12/+21
| | | | | | | | | | | | | | | | | | Just like for addMemOperand(), the function pointer provides a context for allocating memory. This will make it possible to use a better memory allocation strategy for the MI operand list, which is currently a slow std::vector. Most calls to addOperand() come from MachineInstrBuilder, so give that class an MF reference as well. Code using BuildMI() won't need changing at all since the MF reference is already required to allocate a MachineInstr. Future patches will fix code that calls MI::addOperand(Op) directly, as well as code that uses the now deprecated MachineInstrBuilder(MI) constructor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170574 91177308-0d34-0410-b5e6-96231b3b80d8
* Express prepend and append in terms of a more generic insert().Jakob Stoklund Olesen2012-12-131-11/+36
| | | | | | | | Also add an MIBundleBuilder constructor that takes an existing bundle. Together these functions make it possible to add instructions to existing bundles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170063 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an MIBundleBuilder class.Jakob Stoklund Olesen2012-12-071-0/+64
| | | | | | | Like the MachineInstrBuilder, this class makes it easier to build bundles of MachineInstrs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169584 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MachineInstrBuilder::addDisp to copy over target flags by default.Evan Cheng2012-10-111-4/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165677 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new kind of MachineOperand: MO_TargetIndex.Jakob Stoklund Olesen2012-08-071-0/+6
| | | | | | | | | | | | A target index operand looks a lot like a constant pool reference, but it is completely target-defined. It contains the 8-bit TargetFlags, a 32-bit index, and a 64-bit offset. It is preserved by all code generator passes. TargetIndex operands can be used to carry target-specific information in cases where immediate operands won't suffice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161441 91177308-0d34-0410-b5e6-96231b3b80d8
* Add internal read flags to MachineInstrBuilder and hook them into the ↵Pete Cooper2012-06-071-1/+6
| | | | | | MachineOperand flag of the same name git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158137 91177308-0d34-0410-b5e6-96231b3b80d8
* Use <def,undef> operands when spilling NEON bundles.Jakob Stoklund Olesen2012-03-041-0/+1
| | | | | | | | | | | MachineOperands that define part of a virtual register must have an <undef> flag if they are not intended as read-modify-write operands. The old trick of adding an <imp-def> operand doesn't work any longer. Fixes PR12177. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152008 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new kind of MachineOperand: MO_RegisterMask.Jakob Stoklund Olesen2012-01-161-0/+5
| | | | | | | | | | | | | | | | | | | | | Register masks will be used as a compact representation of large clobber lists. Currently, an x86 call instruction has some 40 operands representing call-clobbered registers. That's more than 1kB of useless operands per call site. A register mask operand references a bit mask of call-preserved registers, everything else is clobbered. The bit mask will typically come from TargetRegisterInfo::getCallPreservedMask(). By abandoning ImplicitDefs for call-clobbered registers, it also becomes possible to share call instruction descriptions between calling conventions, and we can get rid of the WINCALL* instructions. This patch introduces the new operand kind. Future patches will add RegMask support to target-independent passes before finally the fixed clobber lists can be removed from call instruction descriptions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148250 91177308-0d34-0410-b5e6-96231b3b80d8
* - Add MachineInstrBundle.h and MachineInstrBundle.cpp. This includes a functionEvan Cheng2011-12-141-0/+46
| | | | | | | | | | | to finalize MI bundles (i.e. add BUNDLE instruction and computing register def and use lists of the BUNDLE instruction) and a pass to unpack bundles. - Teach more of MachineBasic and MachineInstr methods to be bundle aware. - Switch Thumb2 IT block to MI bundles and delete the hazard recognizer hack to prevent IT blocks from being broken apart. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146542 91177308-0d34-0410-b5e6-96231b3b80d8
* - Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo andEvan Cheng2011-06-281-13/+13
| | | | | | | | | sink them into MC layer. - Added MCInstrInfo, which captures the tablegen generated static data. Chang TargetInstrInfo so it's based off MCInstrInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134021 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle debug info for i128 constants.Devang Patel2011-06-241-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133821 91177308-0d34-0410-b5e6-96231b3b80d8
* Frame indices are signed. Update MachineOperand methods accordingly.Jim Grosbach2011-05-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131475 91177308-0d34-0410-b5e6-96231b3b80d8
* add a missing operator that caused us to have to use (*MIB).foo everywhere.Chris Lattner2011-04-291-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130473 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide hooks to set MI flags in MachineInstrBuilderAnton Korobeynikov2011-03-051-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127100 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial va_arg support for x86-64. Patch by David Meyer!Dan Gohman2010-10-121-0/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116319 91177308-0d34-0410-b5e6-96231b3b80d8
* Add const qualifiers to CodeGen's use of LLVM IR constructs.Dan Gohman2010-04-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101334 91177308-0d34-0410-b5e6-96231b3b80d8
* add builder support for mcsymbol operands.Chris Lattner2010-03-131-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98434 91177308-0d34-0410-b5e6-96231b3b80d8
* Further constify MDNode* references.Dale Johannesen2010-02-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97252 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a Debug bit to MachineOperand, for uses thatDale Johannesen2010-02-061-1/+3
| | | | | | | | | | are from debug info. Add an iterator to MachineRegisterInfo to skip Debug operands when walking the use list. No functional change yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95473 91177308-0d34-0410-b5e6-96231b3b80d8
* Further progration of metadata operands. TheDale Johannesen2010-01-131-0/+6
| | | | | | | | | dumper doesn't really do what I want yet, but at least it doesn't crash now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93272 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead code.Devang Patel2009-10-301-7/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85551 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve MachineMemOperand handling.Dan Gohman2009-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | - Allocate MachineMemOperands and MachineMemOperand lists in MachineFunctions. This eliminates MachineInstr's std::list member and allows the data to be created by isel and live for the remainder of codegen, avoiding a lot of copying and unnecessary translation. This also shrinks MemSDNode. - Delete MemOperandSDNode. Introduce MachineSDNode which has dedicated fields for MachineMemOperands. - Change MemSDNode to have a MachineMemOperand member instead of its own fields with the same information. This introduces some redundancy, but it's more consistent with what MachineInstr will eventually want. - Ignore alignment when searching for redundant loads for CSE, but remember the greatest alignment. Target-specific code which previously used MemOperandSDNodes with generic SDNodes now use MemIntrinsicSDNodes, with opcodes in a designated range so that the SelectionDAG framework knows that MachineMemOperand information is available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82794 91177308-0d34-0410-b5e6-96231b3b80d8
* A few more tabs -> spaces.Daniel Dunbar2009-09-201-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82358 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Offset from ExternalSybmol MachineOperands, this is unused (and at ↵Daniel Dunbar2009-09-011-2/+1
| | | | | | least partly unsupported, in X86 encoding at least). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80726 91177308-0d34-0410-b5e6-96231b3b80d8
* add default ctor.Chris Lattner2009-07-091-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75114 91177308-0d34-0410-b5e6-96231b3b80d8
* Add machine operand for MDNodes. This will be used to communicate debug info.Devang Patel2009-07-011-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74628 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a bit IsUndef to MachineOperand. This indicates the def / use register ↵Evan Cheng2009-06-301-3/+8
| | | | | | | | | | | operand is defined by an implicit_def. That means it can def / use any register and passes (e.g. register scavenger) can feel free to ignore them. The register allocator, when it allocates a register to a virtual register defined by an implicit_def, can allocate any physical register without worrying about overlapping live ranges. It should mark all of operands of the said virtual register so later passes will do the right thing. This is not the best solution. But it should be a lot less fragile to having the scavenger try to track what is defined by implicit_def. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74518 91177308-0d34-0410-b5e6-96231b3b80d8
* just eliminate the code entirely!Chris Lattner2009-06-251-28/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74183 91177308-0d34-0410-b5e6-96231b3b80d8
* Clone target flags when copying mbb operands.Chris Lattner2009-06-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74181 91177308-0d34-0410-b5e6-96231b3b80d8
* Identify unconditional gotos and generate a page sel instructions before them.Sanjiv Gupta2009-06-251-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74172 91177308-0d34-0410-b5e6-96231b3b80d8
* ad MachineInstrBuilder support for target flags on operands.Chris Lattner2009-06-251-14/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74155 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MachineInstrBuilder::addReg() to take a flag instead of a list ofBill Wendling2009-05-131-11/+45
| | | | | | | | | | | | | 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()). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71722 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out the code to add a MachineOperand to a MachineInstrBuilder.Dan Gohman2009-02-181-2/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64891 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove non-DebugLoc versions of BuildMI.Dale Johannesen2009-02-131-26/+0
| | | | | | | | "I got blisters on my fingers." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64439 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate a couple of non-DebugLoc BuildMI variants.Dale Johannesen2009-02-121-12/+0
| | | | | | | | Modify callers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64409 91177308-0d34-0410-b5e6-96231b3b80d8
* Create DebugLoc information in FastISel. Several temporary methods wereBill Wendling2009-02-031-7/+52
| | | | | | | | created. Specifically, those BuildMIs which use "DebugLoc::getUnknownLoc()". I'll remove them soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63584 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up #includes, deleting a bunch of unnecessary #includes.Dan Gohman2009-01-051-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61715 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend X86's addFrameReference to add a MachineMemOperand forDan Gohman2008-12-031-0/+5
| | | | | | | | the frame reference. This will help post-RA scheduling determine that spills to distinct stack slots are independent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60486 91177308-0d34-0410-b5e6-96231b3b80d8