mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
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
This commit is contained in:
parent
bc7fa5277f
commit
5c6621c3bc
@ -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); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user