-
Notifications
You must be signed in to change notification settings - Fork 804
Fix recursive zero replacement bottoming out in scalars. #6516
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
Merged
Conversation
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
|
cc: @amaiorano |
|
Let me know if I made the lit-based test correctly. I think I followed the intended pattern, using the |
ben-clayton
reviewed
Apr 10, 2024
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.
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
ben-clayton
reviewed
Apr 10, 2024
llvm-beanz
reviewed
Apr 10, 2024
tools/clang/test/DXC/scalarrepl-param-hlsl-replace-zero-recurse-to-float.ll
Outdated
Show resolved
Hide resolved
Add more check lines to ensure we're examining the right code. Generalize the matched patterns to accomodate local identifier renames.
llvm-beanz
approved these changes
Apr 12, 2024
amaiorano
approved these changes
Apr 12, 2024
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.
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.
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.
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.