diff options
author | Chris Lattner <sabre@nondot.org> | 2006-09-19 04:51:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-09-19 04:51:23 +0000 |
commit | 4c059f496281cb03fefcc6f9f93cdaf8dcc31377 (patch) | |
tree | 9652de50bbc2e5dfe535d061e6182b341bf36119 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | bea5f91946c43c0f2b53de144a7722ebbbaaac02 (diff) | |
download | bcm5719-llvm-4c059f496281cb03fefcc6f9f93cdaf8dcc31377.tar.gz bcm5719-llvm-4c059f496281cb03fefcc6f9f93cdaf8dcc31377.zip |
Minor speedup for legalize by avoiding some malloc traffic
llvm-svn: 30477
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index df6d604bd18..55b128f515d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/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); } |