[llvm] r351318 - [SelectionDAG] Update check in createOperands to reflect max() is a valid value.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 16 02:06:04 PST 2019


Author: fhahn
Date: Wed Jan 16 02:06:04 2019
New Revision: 351318

URL: http://llvm.org/viewvc/llvm-project?rev=351318&view=rev
Log:
[SelectionDAG] Update check in createOperands to reflect max() is a valid value.

The value returned by max() is the last valid value, adjust the
comparison accordingly.

The code added in D55073 creates TokenFactors with max() operands.

Reviewers: aemerson, efriedma, RKSimon, craig.topper

Reviewed By: aemerson

Differential Revision: https://reviews.llvm.org/D56738

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

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=351318&r1=351317&r2=351318&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Jan 16 02:06:04 2019
@@ -9266,7 +9266,7 @@ SDNode *SelectionDAG::isConstantFPBuildV
 
 void SelectionDAG::createOperands(SDNode *Node, ArrayRef<SDValue> Vals) {
   assert(!Node->OperandList && "Node already has operands");
-  assert(std::numeric_limits<decltype(SDNode::NumOperands)>::max() >
+  assert(std::numeric_limits<decltype(SDNode::NumOperands)>::max() >=
              Vals.size() &&
          "too many operands to fit into SDNode");
   SDUse *Ops = OperandRecycler.allocate(




More information about the llvm-commits mailing list