[llvm] r212612 - Sink two variables only used in an assert into the assert itself. Should

Chandler Carruth chandlerc at gmail.com
Wed Jul 9 04:13:16 PDT 2014


Author: chandlerc
Date: Wed Jul  9 06:13:16 2014
New Revision: 212612

URL: http://llvm.org/viewvc/llvm-project?rev=212612&view=rev
Log:
Sink two variables only used in an assert into the assert itself. Should
fix the release builds with Werror.

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=212612&r1=212611&r2=212612&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Wed Jul  9 06:13:16 2014
@@ -2413,7 +2413,6 @@ bool DAGTypeLegalizer::WidenVectorOperan
 SDValue DAGTypeLegalizer::WidenVecOp_ZERO_EXTEND(SDNode *N) {
   SDLoc DL(N);
   EVT VT = N->getValueType(0);
-  unsigned NumElts = VT.getVectorNumElements();
 
   SDValue InOp = N->getOperand(0);
   // If some legalization strategy other than widening is used on the operand,
@@ -2422,8 +2421,9 @@ SDValue DAGTypeLegalizer::WidenVecOp_ZER
   if (getTypeAction(InOp.getValueType()) != TargetLowering::TypeWidenVector)
     return WidenVecOp_Convert(N);
   InOp = GetWidenedVector(InOp);
-  EVT InVT = InOp.getValueType();
-  assert(NumElts < InVT.getVectorNumElements() && "Input wasn't widened!");
+  assert(VT.getVectorNumElements() <
+             InOp.getValueType().getVectorNumElements() &&
+         "Input wasn't widened!");
 
   // Use a special DAG node to represent the operation of zero extending the
   // low lanes.





More information about the llvm-commits mailing list