summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-10-17 21:47:13 +0000
committerChris Lattner <sabre@nondot.org>2006-10-17 21:47:13 +0000
commit78fd0f83ff58137dccad35fa253da4ee5d1010fe (patch)
treeae95cf09ad4af1e722ffdc261f70ee7dfde96597 /llvm/lib
parent327b88b102ccdba3362b99ad0c30201b12ee6e56 (diff)
downloadbcm5719-llvm-78fd0f83ff58137dccad35fa253da4ee5d1010fe.tar.gz
bcm5719-llvm-78fd0f83ff58137dccad35fa253da4ee5d1010fe.zip
Trivial patch to speed up legalizing common i64 constants.
llvm-svn: 31020
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index a2aee097192..45fd350496c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1234,6 +1234,13 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
if (N2C && N2C->getValue() == 0)
return N2;
break;
+ case ISD::OR:
+ case ISD::XOR:
+ // (X ^| 0) -> X. This commonly occurs when legalizing i64 values, so it's
+ // worth handling here.
+ if (N2C && N2C->getValue() == 0)
+ return N1;
+ break;
case ISD::FP_ROUND_INREG:
if (cast<VTSDNode>(N2)->getVT() == VT) return N1; // Not actually rounding.
break;
OpenPOWER on IntegriCloud