Introduce support for the third kind of values in the transform dialect:
value handles. Similarly to operation handles, value handles are
pointing to a set of values in the payload IR. This enables
transformation to be targeted at specific values, such as individual
results of a multi-result payload operation without indirecting through
the producing op or block arguments that previously could not be easily
addressed. This is expected to support a broad class of memory-oriented
transformations such as selective bufferization, buffer assignment, and
memory transfer management.
Value handles are functionally similar to operation handles and require
similar implementation logic. The most important change concerns the
handle invalidation mechanism where operation and value handles can
affect each other.
This patch includes two cleanups that make it easier to introduce value
handles:
- RaggedArray structure that encapsulates the SmallVector of ArrayRef backed by flat SmallVector logic, frequently used in the transform interfaces implementation;
- rewrite the tests that associated payload handles with an integer value reinterpret_casted as a pointer, which were a frequent source of confusion and crashes when adding more debugging facilities that can inspect the payload.
Is this a new op introduced by this change? Is there also a transform.get_defining_op?
Is there a best practice when adding designing transforms ops: Is it better to return OpResults, operations or both?