]> granicus.if.org Git - llvm/commitdiff
[SelectionDAG] Update check in createOperands to reflect max() is a valid value.
authorFlorian Hahn <flo@fhahn.com>
Wed, 16 Jan 2019 10:06:04 +0000 (10:06 +0000)
committerFlorian Hahn <flo@fhahn.com>
Wed, 16 Jan 2019 10:06:04 +0000 (10:06 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351318 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 07ad9c7ce1bfab31bcd00a9b566e0e199c2be615..647496c1afcb92d006f992112fa6e9493ae84391 100644 (file)
@@ -9266,7 +9266,7 @@ SDNode *SelectionDAG::isConstantFPBuildVectorOrConstantFP(SDValue N) {
 
 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(