aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-19 18:01:40 +0000
committerChris Lattner <sabre@nondot.org>2005-01-19 18:01:40 +0000
commit39908e0ce0d8bd9de3c53271f0d27ab9d75816ad (patch)
tree7978da7992cd357e9e2bb09e551c8407dbdb96bd /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent88218ef706ba6fffc3b3f3c894910eea0f59abb1 (diff)
downloadexternal_llvm-39908e0ce0d8bd9de3c53271f0d27ab9d75816ad.tar.gz
external_llvm-39908e0ce0d8bd9de3c53271f0d27ab9d75816ad.tar.bz2
external_llvm-39908e0ce0d8bd9de3c53271f0d27ab9d75816ad.zip
Know some identities about tokenfactor nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19699 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 3b106d192d..762061fa0c 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/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))