[IR] Add info to SSA names: what operand of the linalg op does this correspond to? #1028
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is quite a heavy hammer to apply for SSA name generation but I've found it useful when trying to get my head around the IR. With this change, the operand of the high-level operation is included in the low level op name. For example, now a
.logicalobjectfifo.from_buffers
on column 0 and row 2 which is for moving data of operand number 2 of the top-level operation might look like:The trailing
_C
is added because of a traversal through producers/consumers until compute ops (linalg.generics and func.calls) are found, and indexes determined. The_C
specifically is because the index is 2, and 'C' = 'A' + 2. If it's not unambiguously clear what the index is, this new suffix is just not added.Take a look at the round-trip test added here for more info!
ps. I'm expecting push-back on this one, so I'll say upfront that I'm also happy just to cherry-pick this onto my work branch when I can't follow IR.