Make sure to legalize assert[zs]ext's operand correctly

llvm-svn: 23208
This commit is contained in:
Chris Lattner 2005-09-02 01:15:01 +00:00
parent 06d440f2ee
commit d9af1aab51
1 changed files with 7 additions and 2 deletions

View File

@ -456,14 +456,19 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
assert(0 && "Do not know how to legalize this operator!");
abort();
case ISD::EntryToken:
case ISD::AssertSext:
case ISD::AssertZext:
case ISD::FrameIndex:
case ISD::GlobalAddress:
case ISD::ExternalSymbol:
case ISD::ConstantPool: // Nothing to do.
assert(isTypeLegal(Node->getValueType(0)) && "This must be legal!");
break;
case ISD::AssertSext:
case ISD::AssertZext:
Tmp1 = LegalizeOp(Node->getOperand(0));
if (Tmp1 != Node->getOperand(0))
Result = DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1,
Node->getOperand(1));
break;
case ISD::CopyFromReg:
Tmp1 = LegalizeOp(Node->getOperand(0));
if (Tmp1 != Node->getOperand(0))