[PATCH] D56739: [SelectionDAG] Add getTokenFactor, which splits nodes with > 64k operands.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 16 14:06:35 PST 2019


RKSimon added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:9291
+SDValue SelectionDAG::getTokenFactor(const SDLoc &DL,
+                                     SmallVector<SDValue, 8> &Vals) {
+  size_t Limit = std::numeric_limits<decltype(SDNode::NumOperands)>::max();
----------------
Maybe better to use an ArrayRef<SDValue> here instead of modifying an external value?


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:9292
+                                     SmallVector<SDValue, 8> &Vals) {
+  size_t Limit = std::numeric_limits<decltype(SDNode::NumOperands)>::max();
+  while (Vals.size() > Limit) {
----------------
Would it be better to create a SDNode::getMaxNumOperands() static/constexpr helper to do this?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56739/new/

https://reviews.llvm.org/D56739





More information about the llvm-commits mailing list