[llvm] r185824 - Improve the comment from r185794 (re: PromoteIntRes_BUILD_VECTOR)

Hal Finkel hfinkel at anl.gov
Mon Jul 8 07:40:05 PDT 2013


Author: hfinkel
Date: Mon Jul  8 09:40:04 2013
New Revision: 185824

URL: http://llvm.org/viewvc/llvm-project?rev=185824&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=185824&r1=185823&r2=185824&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Mon Jul  8 09:40:04 2013
@@ -2931,8 +2931,10 @@ SDValue DAGTypeLegalizer::PromoteIntRes_
   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





More information about the llvm-commits mailing list