summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorMon P Wang <wangmp@apple.com>2010-02-01 22:15:09 +0000
committerMon P Wang <wangmp@apple.com>2010-02-01 22:15:09 +0000
commitd74e0023c589273664250ba35506328784911107 (patch)
tree54b6226a0a81b3a01e6a431962fb5f7ece36ed5a /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent47cbefac9461d1822dd7b70dcbcd74f2b162f711 (diff)
downloadbcm5719-llvm-d74e0023c589273664250ba35506328784911107.tar.gz
bcm5719-llvm-d74e0023c589273664250ba35506328784911107.zip
Improve EXTRACT_VECTOR_ELT patch based on comments from Duncan
llvm-svn: 95012
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp5
1 files changed, 1 insertions, 4 deletions
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;
}
OpenPOWER on IntegriCloud