diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-06-15 07:22:16 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-06-15 07:22:16 +0000 |
commit | 8d3af5e7d082dbd029c3987ceadbdcf9e49af6d7 (patch) | |
tree | 547f49ec73cb087e6ccee2b0779efc5f2fc335ab /lib/CodeGen | |
parent | d7c2c86239dd543906c363e45e18766223d14c6e (diff) | |
download | llvm-8d3af5e7d082dbd029c3987ceadbdcf9e49af6d7.tar.gz llvm-8d3af5e7d082dbd029c3987ceadbdcf9e49af6d7.tar.bz2 llvm-8d3af5e7d082dbd029c3987ceadbdcf9e49af6d7.tar.xz |
Instructions with variable operands (variable_ops) can have a number required
operands. e.g.
def CALL32r : I<0xFF, MRM2r, (ops GR32:$dst, variable_ops),
"call {*}$dst", [(X86call GR32:$dst)]>;
TableGen should emit operand informations for the "required" operands.
Added a target instruction info flag M_VARIABLE_OPS to indicate the target
instruction may have more operands in addition to the minimum required
operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 8003afa0ba..480364a282 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -91,7 +91,8 @@ MachineInstr *MachineInstr::removeFromParent() { /// bool MachineInstr::OperandsComplete() const { int NumOperands = TargetInstrDescriptors[Opcode].numOperands; - if (NumOperands >= 0 && getNumOperands() >= (unsigned)NumOperands) + if ((TargetInstrDescriptors[Opcode].Flags & M_VARIABLE_OPS) == 0 && + getNumOperands() >= (unsigned)NumOperands) return true; // Broken: we have all the operands of this instruction! return false; } diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index 1d154017f5..5d404f0766 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -358,7 +358,8 @@ void ScheduleDAG::EmitNode(SDNode *Node, unsigned NodeOperands = CountOperands(Node); unsigned NumMIOperands = NodeOperands + NumResults; #ifndef NDEBUG - assert((unsigned(II.numOperands) == NumMIOperands || II.numOperands == -1)&& + assert((unsigned(II.numOperands) == NumMIOperands || + (II.Flags & M_VARIABLE_OPS)) && "#operands for dag node doesn't match .td file!"); #endif |