[llvm-commits] [llvm] r160311 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
Nadav Rotem
nadav.rotem at intel.com
Mon Jul 16 11:56:40 PDT 2012
Author: nadav
Date: Mon Jul 16 13:56:39 2012
New Revision: 160311
URL: http://llvm.org/viewvc/llvm-project?rev=160311&view=rev
Log:
Minor cleanup and docs.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=160311&r1=160310&r2=160311&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Mon Jul 16 13:56:39 2012
@@ -155,7 +155,9 @@
SDValue DAGTypeLegalizer::ScalarizeVecRes_BUILD_VECTOR(SDNode *N) {
EVT EltVT = N->getValueType(0).getVectorElementType();
SDValue InOp = N->getOperand(0);
- if (InOp.getValueType() != EltVT)
+ // The BUILD_VECTOR operands may be of wider element types and
+ // we may need to truncate them back to the requested return type.
+ if (EltVT.isInteger())
return DAG.getNode(ISD::TRUNCATE, N->getDebugLoc(), EltVT, InOp);
return InOp;
}
More information about the llvm-commits
mailing list