mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-13 08:26:02 +00:00
Another simple xform
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21317 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -964,6 +964,14 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
|
|||||||
return getSetCC(Result, LHS->getValueType(0), LL, LR);
|
return getSetCC(Result, LHS->getValueType(0), LL, LR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// and/or zext(a), zext(b) -> zext(and/or a, b)
|
||||||
|
if (N1.getOpcode() == ISD::ZERO_EXTEND &&
|
||||||
|
N2.getOpcode() == ISD::ZERO_EXTEND &&
|
||||||
|
N1.getOperand(0).getValueType() == N2.getOperand(0).getValueType())
|
||||||
|
return getNode(ISD::ZERO_EXTEND, VT,
|
||||||
|
getNode(Opcode, N1.getOperand(0).getValueType(),
|
||||||
|
N1.getOperand(0), N2.getOperand(0)));
|
||||||
break;
|
break;
|
||||||
case ISD::XOR:
|
case ISD::XOR:
|
||||||
if (N1 == N2) return getConstant(0, VT); // xor X, Y -> 0
|
if (N1 == N2) return getConstant(0, VT); // xor X, Y -> 0
|
||||||
|
Reference in New Issue
Block a user