-
Notifications
You must be signed in to change notification settings - Fork 12k
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
[HLSL] Eliminate resource global variables from module #104271
Labels
Comments
3 tasks
5 tasks
This was referenced Sep 24, 2024
bogner
changed the title
[HLSL] Strip resource global variables from module
[HLSL] Eliminate resource global variables from module
Oct 21, 2024
10 tasks
pow2clk
added a commit
to pow2clk/llvm-project
that referenced
this issue
Oct 29, 2024
By giving these intrinsics their appropriate attributes, loads of allocas that are stored on the other side of these calls can be eliminated. Adds a test that verifies that the unneeded loads can be eliminated and also that the attributes are set properly. Fixes llvm#104271 This may be the first part of a broader audit of
pow2clk
added a commit
to pow2clk/llvm-project
that referenced
this issue
Oct 30, 2024
By giving these intrinsics their appropriate attributes, loads of globals that are stored on the other side of these calls can be eliminated by the EarlyCSE pass. Stores to the same globals and the globals themselves require more direct intervention as part of the handleFromBinding lowering. Adds a test that verifies that the unneeded globals and their uses can be eliminated and also that the attributes are set properly. Fixes llvm#104271
pow2clk
added a commit
that referenced
this issue
Nov 12, 2024
By giving these intrinsics their appropriate attributes, loads of globals that are stored on the other side of these calls can be eliminated by the EarlyCSE pass. Stores to the same globals and the globals themselves require more direct intervention as part of the create/annotated handle lowering. Adds a test that verifies that the unneeded globals and their uses can be eliminated and also that the attributes are set properly. Fixes #104271
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Global variables that represent shader resources need to be stripped from the final DXIL module, and accesses to resources need to happen locally rather than by round tripping through loads and stores of the global.
We'll need to either write a specific pass to eliminate global accesses to the resource (which needs to happen after inlining), or augment EarlyCSE and/or GVN to do so for us.
For example in this simple shader, we may end up with IR like so before lowering to DXIL ops:
Here, the store to
@In
and the load from the same for the argument totypedBufferLoad
need to be eliminated. Note that in this case EarlyCSE was able to eliminate the load in the first call totypedBufferLoad
but not the second.The text was updated successfully, but these errors were encountered: