mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-15 09:51:00 +00:00
Fix a thinko. If the operand is promoted, pass the promoted value into
the new zero extend, not the original operand. This fixes cast bool -> long on ppc. Add an unrelated fixme llvm-svn: 21196
This commit is contained in:
parent
c1bacbff9d
commit
b3518a838c
@ -1937,7 +1937,7 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
|
||||
|
||||
// The low part is just a zero extension of the input (which degenerates to
|
||||
// a copy).
|
||||
Lo = DAG.getNode(ISD::ZERO_EXTEND, NVT, LegalizeOp(Node->getOperand(0)));
|
||||
Lo = DAG.getNode(ISD::ZERO_EXTEND, NVT, In);
|
||||
|
||||
// The high part is just a zero.
|
||||
Hi = DAG.getConstant(0, NVT);
|
||||
|
@ -767,6 +767,10 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
|
||||
if (N2C->isAllOnesValue())
|
||||
return N1; // X and -1 -> X
|
||||
|
||||
// FIXME: Should add a corresponding version of this for
|
||||
// ZERO_EXTEND/SIGN_EXTEND by converting them to an ANY_EXTEND node which
|
||||
// we don't have yet.
|
||||
|
||||
// and (zero_extend_inreg x:16:32), 1 -> and x, 1
|
||||
if (N1.getOpcode() == ISD::ZERO_EXTEND_INREG ||
|
||||
N1.getOpcode() == ISD::SIGN_EXTEND_INREG) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user