From 4c8f8f0481b26818d7810a6a585e7ecf52973e93 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 13 Oct 2005 20:07:41 +0000 Subject: [PATCH] Implement PromoteOp for *EXTLOAD, allowing MallocBench/gs to Legalize git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23715 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 8ea3eb78847..3fcf45afe38 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -2350,6 +2350,16 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) { // Remember that we legalized the chain. AddLegalizedOperand(Op.getValue(1), Result.getValue(1)); break; + case ISD::SEXTLOAD: + case ISD::ZEXTLOAD: + case ISD::EXTLOAD: + Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain. + Tmp2 = LegalizeOp(Node->getOperand(1)); // Legalize the pointer. + Result = DAG.getNode(Node->getOpcode(), NVT, Tmp1, Tmp2, + Node->getOperand(2), Node->getOperand(3)); + // Remember that we legalized the chain. + AddLegalizedOperand(Op.getValue(1), Result.getValue(1)); + break; case ISD::SELECT: switch (getTypeAction(Node->getOperand(0).getValueType())) { case Expand: assert(0 && "It's impossible to expand bools");