aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/MachineInstr.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-31 20:50:53 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-31 20:50:53 +0000
commit94083149fd6891c8a72472cf1814fa6600a75979 (patch)
tree789b62b2c8d309986e5ce08490b80464556971b4 /include/llvm/CodeGen/MachineInstr.h
parent265bcb1e5b106a7c5db2bfcfb13cceffe0c413be (diff)
downloadexternal_llvm-94083149fd6891c8a72472cf1814fa6600a75979.zip
external_llvm-94083149fd6891c8a72472cf1814fa6600a75979.tar.gz
external_llvm-94083149fd6891c8a72472cf1814fa6600a75979.tar.bz2
Add MachineInstr::tieOperands, remove setIsTied().
Manage tied operands entirely internally to MachineInstr. This makes it possible to change the representation of tied operands, as I will do shortly. The constraint that tied uses and defs must be in the same order was too restrictive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163021 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstr.h')
-rw-r--r--include/llvm/CodeGen/MachineInstr.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index d636dfd..67ae3f9 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -782,6 +782,14 @@ public:
const TargetInstrInfo *TII,
const TargetRegisterInfo *TRI) const;
+ /// tieOperands - Add a tie between the register operands at DefIdx and
+ /// UseIdx. The tie will cause the register allocator to ensure that the two
+ /// operands are assigned the same physical register.
+ ///
+ /// Tied operands are managed automatically for explicit operands in the
+ /// MCInstrDesc. This method is for exceptional cases like inline asm.
+ void tieOperands(unsigned DefIdx, unsigned UseIdx);
+
/// 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.
@@ -942,9 +950,11 @@ private:
/// 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);
+ MachineOperand &MO = getOperand(OpIdx);
+ if (MO.isReg() && MO.isTied()) {
+ getOperand(findTiedOperandIdx(OpIdx)).IsTied = false;
+ MO.IsTied = false;
+ }
}
/// addImplicitDefUseOperands - Add all implicit def and use operands to