[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Chris Lattner
sabre at nondot.org
Mon Sep 18 21:51:38 PDT 2006
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAG.cpp updated: 1.338 -> 1.339
---
Log message:
Minor speedup for legalize by avoiding some malloc traffic
---
Diffs of the changes: (+9 -0)
SelectionDAG.cpp | 9 +++++++++
1 files changed, 9 insertions(+)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.338 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.339
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.338 Tue Sep 12 16:00:35 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Sep 18 23:51:23 2006
@@ -1329,6 +1329,15 @@
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); }
More information about the llvm-commits
mailing list