aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-19 04:51:23 +0000
committerChris Lattner <sabre@nondot.org>2006-09-19 04:51:23 +0000
commit5c6621c3bc7e53e0754cb74062d27a6e8b7275e8 (patch)
tree918628d0ff27f399f675b10293b79e1fb1020126 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentbc7fa5277ffedc6f5874463101eed3d510c772f3 (diff)
Minor speedup for legalize by avoiding some malloc traffic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30477 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index df6d604bd1..55b128f515 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1329,6 +1329,15 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
if (EVT == VT) return N1; // Not actually extending
break;
}
+ case ISD::EXTRACT_ELEMENT:
+ // EXTRACT_ELEMENT of BUILD_PAIR is often formed while legalize is expanding
+ // 64-bit integers into 32-bit parts. Instead of building the extract of
+ // the BUILD_PAIR, only to have legalize rip it apart, just do it now.
+ if (N2C && N1.getOpcode() == ISD::BUILD_PAIR) {
+ assert((unsigned)N2C->getValue() < 2 && "Bad EXTRACT_ELEMENT!");
+ return N1.getOperand(N2C->getValue());
+ }
+ break;
// FIXME: figure out how to safely handle things like
// int foo(int x) { return 1 << (x & 255); }