mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-12 18:33:22 +00:00
Eliminate unneeded extensions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19577 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8b6fa22e72
commit
950aa3ca2c
@ -855,6 +855,15 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,SDOperand N1,
|
||||
"Cannot *_EXTEND_INREG FP types");
|
||||
if (EVT == VT) return N1; // Not actually extending
|
||||
assert(EVT < VT && "Not extending!");
|
||||
|
||||
// If we are sign extending an extension, use the original source.
|
||||
if (N1.getOpcode() == ISD::ZERO_EXTEND_INREG ||
|
||||
N1.getOpcode() == ISD::SIGN_EXTEND_INREG) {
|
||||
if (N1.getOpcode() == Opcode &&
|
||||
cast<MVTSDNode>(N1)->getExtraValueType() <= EVT)
|
||||
return N1;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user