Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IR] Add info to SSA names: what operand of the linalg op does this correspond to? #1028

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

newling
Copy link
Contributor

@newling newling commented Jan 14, 2025

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:

%lof_0_2_C =  amdaie.logicalobjectfifo.from_buffers(
              {%buffer_0_2_C}, {%lock_0_2_10}, {%lock_0_2_11}) 
               : memref<1024xf32, 2 : i32> -> !amdaie.logicalobjectfifo<memref<1024xf32, 2 : i32>>

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.

@newling newling force-pushed the additional_ssa_improvements branch 3 times, most recently from 1bb33a8 to df54513 Compare January 16, 2025 22:57
@newling newling force-pushed the additional_ssa_improvements branch from df54513 to 84ed1f0 Compare January 16, 2025 23:28
@newling newling changed the title [WIP] Add consistency to IR [IR] Add info to SSA names: what operand of the linalg op does this correspond to? Jan 16, 2025
@newling newling marked this pull request as ready for review January 16, 2025 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant