Repository navigation
Fix recursive zero replacement bottoming out in scalars. - #6516
Merged
Merged
Conversation
Collaborator
Author
Collaborator
Author
|
Let me know if I made the lit-based test correctly. I think I followed the intended pattern, using the |
During memcpy replacement, the scalarrepl-param-hlsl pass will replace certain uses of a zero-initialized global variable. The pass uses a recursive algorithm to replace uses of that global by a zero value. The current code expects the recursion to bottom out in an aggregate type. But it can bottom out in a scalar integer or scalar float. This patch fixes the scalar cases. Lit-based pass tests are included.
David Neto (dneto0)
force-pushed
the
sroa-fix
branch
from
April 10, 2024 16:42
70a2ba8 to
6aff7ba
Compare
Contributor
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
Add more check lines to ensure we're examining the right code. Generalize the matched patterns to accomodate local identifier renames.
Chris B (llvm-beanz)
approved these changes
Apr 12, 2024
Antonio Maiorano (amaiorano)
self-requested a review
April 12, 2024 15:01
Antonio Maiorano (amaiorano)
approved these changes
Apr 12, 2024
Antonio Maiorano (amaiorano)
added a commit
to amaiorano/DirectXShaderCompiler
that referenced
this pull request
Aug 9, 2024
This is the same fix as was done in microsoft#6516 except that this is for replace uses of zero-init for instructions in the entry block.
Antonio Maiorano (amaiorano)
added a commit
that referenced
this pull request
Aug 12, 2024
This is the same fix as was done in #6516 except that this is for replace uses of zero-init for instructions in the entry block.
Mxr (SjMxr233)
pushed a commit
to ShaderHelper/DirectXShaderCompiler
that referenced
this pull request
Jul 24, 2025
This is the same fix as was done in microsoft#6516 except that this is for replace uses of zero-init for instructions in the entry block.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
During memcpy replacement, the scalarrepl-param-hlsl pass will replace certain uses of a zero-initialized global variable. The pass uses a recursive algorithm to replace uses of that global by a zero value. The current code expects the recursion to bottom out in an aggregate type. But it can bottom out in a scalar integer or scalar float.
This patch fixes the scalar cases.
Lit-based pass tests are included.