From 08951a32fbc1de3ec3746e14109a74ca506ca251 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 2 Sep 2005 01:15:01 +0000 Subject: [PATCH] Make sure to legalize assert[zs]ext's operand correctly git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23208 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 235fe0f3efe..461104c1f58 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -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)) -- 2.34.1