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.
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
lgc: add dialect GroupMemcpyOp #2802
lgc: add dialect GroupMemcpyOp #2802
Changes from all commits
da88fdc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is a good idea to place the handling of group memcpy here because the pass is aimed to handle entry-point mutation. Other responsibilities should be moved to other passes or even creating a new pass according to LLVM design philosophy.
The handling of task/mesh shader could be put in MeshTaskShader.cpp. For CS, many operations are straightforward, if possible, maybe we can place it on InOutBuilder since readCsBuiltIn() can read back any CS built-in so you can do anything you want. This is true for task shader as well and share the handling. If that is impossible, we can move the handling of CS to PatchInOutImportExport.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a similar thought in the internal review - split the op into 2: one for task/mesh and another for compute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can check shader stage when lowering this op so we can differentiate its usages in task/mesh shader or in compute shader. If you decide to make two dedicated ops, that is fine as well.
I discussed this with Ruiling, we both believe the lowering of this op is better to be moved to other appropriate passes other than this pass. Also, if you can share us with a LGC file (.lgc generated by frontend with the option --emit-lgc) showing the usage of this op we can better evaluate your future refactoring change in the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is natural to handle task/mesh shader in MeshTaskShader.cpp but for CS, it is also weird to place the code in InOutBuilder or PatchInOutImportExport. Actually my only intent is to use this for task shader only. The llpcfe standalone tool doesn't seem to support -emit-lgc but the dump should have all the information you need.
I modified code in a commit here.
And a pipeline dump attached.
PipelineTaskMesh_0xB812ED624A368A8F.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I see the usage. Your requirement is similar to the usage of
PatchInitializeWorkgroupMemory::initializeWithZero
. We add a new pass to handle this. Anyway, it is fine to keep CS handling in entry-point mutation as a temporary solution and move the handling of task/mesh shader to MeshTaskShader class. I plan to rework the passPatchInitializeWorkgroupMemory
and try to enable the usage for your case in the near future.