From d74e0023c589273664250ba35506328784911107 Mon Sep 17 00:00:00 2001 From: Mon P Wang Date: Mon, 1 Feb 2010 22:15:09 +0000 Subject: Improve EXTRACT_VECTOR_ELT patch based on comments from Duncan llvm-svn: 95012 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 6729a93fd71..10487dabd28 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -5411,10 +5411,7 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) { EVT NVT = N->getValueType(0); if (InOp.getValueType() != NVT) { assert(InOp.getValueType().isInteger() && NVT.isInteger()); - if (NVT.getSizeInBits() > InOp.getValueType().getSizeInBits()) - return DAG.getNode(ISD::SIGN_EXTEND, InVec.getDebugLoc(), NVT, InOp); - else - return DAG.getNode(ISD::TRUNCATE, InVec.getDebugLoc(), NVT, InOp); + return DAG.getSExtOrTrunc(InOp, InVec.getDebugLoc(), NVT); } return InOp; } -- cgit v1.2.3