summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetInstrInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/TargetInstrInfo.cpp')
-rw-r--r--llvm/lib/Target/TargetInstrInfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetInstrInfo.cpp b/llvm/lib/Target/TargetInstrInfo.cpp
index 4346203d917..81759098ed8 100644
--- a/llvm/lib/Target/TargetInstrInfo.cpp
+++ b/llvm/lib/Target/TargetInstrInfo.cpp
@@ -38,6 +38,18 @@ TargetInstrInfo::~TargetInstrInfo() {
TargetInstrDescriptors = NULL; // reset global variable
}
+int
+TargetInstrInfo::getTiedToSrcOperand(MachineOpCode Opc, unsigned OpNum) const {
+ for (unsigned i = 0, e = getNumOperands(Opc); i != e; ++i) {
+ if (i == OpNum)
+ continue;
+ int ti = getOperandConstraint(Opc, i, TIED_TO);
+ if (ti == (int)OpNum)
+ return i;
+ }
+ return -1;
+}
+
// commuteInstruction - The default implementation of this method just exchanges
// operand 1 and 2.
OpenPOWER on IntegriCloud