tqchen commented on PR #15916: URL: https://github.com/apache/tvm/pull/15916#issuecomment-1788006758
> as many constraints exposed to the C++ type system as possible This is indeed also a tradeoff here in terms of IR design. We cannot encode all constraints, for example the ANF itself is not encoded directly in the c++ data structure, but still enforced through well-form checkers. For this particular case, because we can possibly allow unbounded usecases to support **N0: Structural intrinsic argument**. The possible usecases go beyond CallTIR, that also include call packed, possible nested structures etc. So enabling it in the normal form is a good tradeoff > It occurs after a pass has been designed and written A pass that follows the common pattern(rewrites Call and not rewrites Tuple) will not face such issues. A pass that needs to do tuple replacement already have other complications to consider. And if the pass writer is not willing to do so, having a followup util function(like ConvertSSA) will simply unpack the tuple values and recovert things back to the normal form, without need to redesign the original pass. Indeed, this extra burden is put on developers that develops pass that involves tuple remapping, such pass in nature would require extra set of considerations. And the extra overhead of insertin a re-normalization is not high. They are less common than the passes that involves pattern match and rewrite structural intrinsic argument. That is also why the design prioritizes these cases. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
