aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-07-08 14:40:04 +0000
committerHal Finkel <hfinkel@anl.gov>2013-07-08 14:40:04 +0000
commit6c75160b875799a9303879e11022edf4ba44c3f9 (patch)
tree65f5bc291194ca824fc3c561327092cc65473eb8 /lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
parent12ae7fd2da24e53c795c0cc17d06c91a0f09fb3d (diff)
downloadexternal_llvm-6c75160b875799a9303879e11022edf4ba44c3f9.zip
external_llvm-6c75160b875799a9303879e11022edf4ba44c3f9.tar.gz
external_llvm-6c75160b875799a9303879e11022edf4ba44c3f9.tar.bz2
Improve the comment from r185794 (re: PromoteIntRes_BUILD_VECTOR)
In response to Duncan's review, I believe that the original comment was not as clear as it could be. Hopefully, this is better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185824 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index df38898..76c028d 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -2931,8 +2931,10 @@ SDValue DAGTypeLegalizer::PromoteIntRes_BUILD_VECTOR(SDNode *N) {
Ops.reserve(NumElems);
for (unsigned i = 0; i != NumElems; ++i) {
SDValue Op;
- // It is possible for the operands to be larger than the result, for example,
- // when the operands are promoted booleans and the result was an i1 vector.
+ // BUILD_VECTOR integer operand types are allowed to be larger than the
+ // result's element type. This may still be true after the promotion. For
+ // example, we might be promoting (<v?i1> = BV <i32>, <i32>, ...) to
+ // (v?i16 = BV <i32>, <i32>, ...), and we can't any_extend <i32> to <i16>.
if (N->getOperand(i).getValueType().bitsLT(NOutVTElem))
Op = DAG.getNode(ISD::ANY_EXTEND, dl, NOutVTElem, N->getOperand(i));
else