aboutsummaryrefslogtreecommitdiff
path: root/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
commit87c46d8a0e9d85d39bfd93a4e6307a871075add6 (patch)
treee15803781ca2211a4396cd14d0bfd079d9d8b956 /lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parentc54a747352f3f1bb2e83d33e8cca43e6a66c2f93 (diff)
Improve EXTRACT_VECTOR_ELT patch based on comments from Duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95012 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 6729a93fd7..10487dabd2 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/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;
}