[PATCH] D56738: [SelectionDAG] Update check in createOperands to reflect max() is a valid value.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 15 11:58:22 PST 2019


fhahn created this revision.
fhahn added reviewers: aemerson, efriedma, RKSimon, craig.topper.
Herald added a subscriber: hiraditya.

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

The code added in D55073 <https://reviews.llvm.org/D55073> creates TokenFactors with max() operands.


https://reviews.llvm.org/D56738

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -9266,7 +9266,7 @@
 
 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(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56738.181845.patch
Type: text/x-patch
Size: 648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190115/44a1ae75/attachment.bin>


More information about the llvm-commits mailing list