diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-11-04 09:44:31 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-11-04 09:44:31 +0000 |
commit | 95f6edeff5ab6de9cf5589f662c8e7a6ba119c2c (patch) | |
tree | d232f71c2fbb8feda0a0e53f53d1ea35451eff7c /lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | |
parent | fe0b81759d207072ae468f5154f6a513c3a1be72 (diff) |
Changes to use operand constraints to process two-address instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31453 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index cfc27a32d5..dd968ed454 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -126,8 +126,13 @@ void ScheduleDAG::BuildSchedUnits() { if (MainNode->isTargetOpcode()) { unsigned Opc = MainNode->getTargetOpcode(); - if (TII->isTwoAddrInstr(Opc)) - SU->isTwoAddress = true; + for (unsigned i = 0, ee = TII->getNumOperands(Opc); i != ee; ++i) { + if (TII->getOperandConstraint(Opc, i, + TargetInstrInfo::TIED_TO) != -1) { + SU->isTwoAddress = true; + break; + } + } if (TII->isCommutableInstr(Opc)) SU->isCommutable = true; } @@ -210,7 +215,7 @@ void ScheduleDAG::CalculateHeights() { /// CountResults - The results of target nodes have register or immediate /// operands first, then an optional chain, and optional flag operands (which do /// not go into the machine instrs.) -static unsigned CountResults(SDNode *Node) { +unsigned ScheduleDAG::CountResults(SDNode *Node) { unsigned N = Node->getNumValues(); while (N && Node->getValueType(N - 1) == MVT::Flag) --N; @@ -222,7 +227,7 @@ static unsigned CountResults(SDNode *Node) { /// CountOperands The inputs to target nodes have any actual inputs first, /// followed by an optional chain operand, then flag operands. Compute the /// number of actual operands that will go into the machine instr. -static unsigned CountOperands(SDNode *Node) { +unsigned ScheduleDAG::CountOperands(SDNode *Node) { unsigned N = Node->getNumOperands(); while (N && Node->getOperand(N - 1).getValueType() == MVT::Flag) --N; |