From 62f2a3c7aa0eba3e7bc5e2d59e268c5e1f48fb46 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 10 Oct 2006 07:51:21 +0000 Subject: [PATCH] Fix a bug introduced by my LOAD/LOADX changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30853 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index a3adb55d894..699d5b1574b 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -2433,7 +2433,6 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { // This defaults to loading a pointer from the input and storing it to the // output, returning the chain. SrcValueSDNode *SVD = cast(Node->getOperand(3)); - SrcValueSDNode *SVS = cast(Node->getOperand(4)); Tmp4 = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp3, SVD->getValue(), SVD->getOffset()); Result = DAG.getStore(Tmp4.getValue(1), Tmp4, Tmp2, Node->getOperand(4)); @@ -3234,7 +3233,10 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) { case ISD::LOAD: { LoadSDNode *LD = cast(Node); - Result = DAG.getExtLoad(ISD::EXTLOAD, NVT, LD->getChain(), LD->getBasePtr(), + ISD::LoadExtType ExtType = ISD::isNON_EXTLoad(Node) + ? ISD::EXTLOAD : LD->getExtensionType(); + Result = DAG.getExtLoad(ExtType, NVT, + LD->getChain(), LD->getBasePtr(), LD->getSrcValue(), LD->getSrcValueOffset(), VT); // Remember that we legalized the chain. AddLegalizedOperand(Op.getValue(1), LegalizeOp(Result.getValue(1)));