From: Chris Lattner Date: Tue, 18 Jan 2005 21:57:59 +0000 (+0000) Subject: Zero is cheaper than sign extend. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d5d56825123665b60d4eada0a4ad7d0adc5cf3a3;p=oota-llvm.git Zero is cheaper than sign extend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19675 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 8c6c10d583d..52e723a57e5 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -793,7 +793,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { case ISD::SIGN_EXTEND: Result = PromoteOp(Node->getOperand(0)); // NOTE: Any extend would work here... - Result = DAG.getNode(ISD::SIGN_EXTEND, Op.getValueType(), Result); + Result = DAG.getNode(ISD::ZERO_EXTEND, Op.getValueType(), Result); Result = DAG.getNode(ISD::SIGN_EXTEND_INREG, Result.getValueType(), Result, Node->getOperand(0).getValueType()); break;