diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-01-19 18:01:40 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-01-19 18:01:40 +0000 |
| commit | 9b75e148fdc7453cf7804eac9faa142ed19ca541 (patch) | |
| tree | f9abd19692fbc05f0f5345b16f3ad546170f3075 /llvm/lib/CodeGen | |
| parent | 32a5f02598a815b3add3a8e42fb58504201d0b5d (diff) | |
| download | bcm5719-llvm-9b75e148fdc7453cf7804eac9faa142ed19ca541.tar.gz bcm5719-llvm-9b75e148fdc7453cf7804eac9faa142ed19ca541.zip | |
Know some identities about tokenfactor nodes.
llvm-svn: 19699
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 3b106d192d1..762061fa0c7 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -549,6 +549,10 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, SDOperand N1, SDOperand N2) { #ifndef NDEBUG switch (Opcode) { + case ISD::TokenFactor: + assert(VT == MVT::Other && N1.getValueType() == MVT::Other && + N2.getValueType() == MVT::Other && "Invalid token factor!"); + break; case ISD::AND: case ISD::OR: case ISD::XOR: @@ -739,6 +743,13 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, // Finally, fold operations that do not require constants. switch (Opcode) { + case ISD::TokenFactor: + if (N1.getOpcode() == ISD::EntryToken) + return N2; + if (N2.getOpcode() == ISD::EntryToken) + return N1; + break; + case ISD::AND: case ISD::OR: if (SetCCSDNode *LHS = dyn_cast<SetCCSDNode>(N1.Val)) |

