diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-08-29 00:37:58 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-08-29 00:37:58 +0000 |
commit | 699ac049517285d978ed607b2735976c5ae97ac0 (patch) | |
tree | e8e450ff1a7efcef0c33adf36bde5b5f41b1ee22 /include | |
parent | 14b5bac547ac3f9da2e66d82a8ebc4a8c93af031 (diff) | |
download | external_llvm-699ac049517285d978ed607b2735976c5ae97ac0.zip external_llvm-699ac049517285d978ed607b2735976c5ae97ac0.tar.gz external_llvm-699ac049517285d978ed607b2735976c5ae97ac0.tar.bz2 |
Maintain a vaild isTied bit as operands are added and removed.
The isTied bit is set automatically when a tied use is added and
MCInstrDesc indicates a tied operand. The tie is broken when one of the
tied operands is removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 27756ab..e88351c 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -782,6 +782,11 @@ public: const TargetInstrInfo *TII, const TargetRegisterInfo *TRI) const; + /// findTiedOperandIdx - Given the index of a tied register operand, find the + /// operand it is tied to. Defs are tied to uses and vice versa. Returns the + /// index of the tied operand which must exist. + unsigned findTiedOperandIdx(unsigned OpIdx) const; + /// isRegTiedToUseOperand - Given the index of a register def operand, /// check if the register def is tied to a source operand, due to either /// two-address elimination or inline assembly constraints. Returns the @@ -935,6 +940,13 @@ private: /// return null. MachineRegisterInfo *getRegInfo(); + /// untieRegOperand - Break any tie involving OpIdx. + void untieRegOperand(unsigned OpIdx) { + const MachineOperand &MO = getOperand(OpIdx); + if (MO.isReg() && MO.isTied()) + getOperand(findTiedOperandIdx(OpIdx)).setIsTied(false); + } + /// addImplicitDefUseOperands - Add all implicit def and use operands to /// this instruction. void addImplicitDefUseOperands(); |