Why limit to the 64k on the number of SDNode operands in SelectionDAG?

Hi, all

Why limit to the 64k on the number of SDNode operands in “Selection::createOperands()”?

If it has over the 64k on the number of SDNode, it occurs the assertion.

This commit is related the contents on above.

[SelectionDAG] Split very large token factors for loads into 64k chunks

Also, the return value type of “SDNode::getMaxNumOperands” function is “size_t”, but really the return value type is fixed “unsigned short” because the type of “SDNode::NumOperands” is “unsigned short”.

This commit is related the contents on above.

[SelectionDAG] Add static getMaxNumOperands function to SDNode.

Thanks.
Best Regards.

Is the question just “why is SDNode::NumOperands unsigned short?” It’s to save a bit of memory: two “unsigned short” values are 4 bytes, where two “size_t” values would be 16 bytes. Not sure how much it realistically matters; I don’t think anyone has really tried to evaluate the performance impact of changing that.

-Eli