Repository navigation
[SM6.9] Prevent GVN from generating illegal integers - #9044
Open
Chris B (llvm-beanz) wants to merge 3 commits into
Open
Chris B (llvm-beanz) wants to merge 3 commits into
Chris B (llvm-beanz) wants to merge 3 commits into
Conversation
This change is a more complete set of checks to avoid GVN generating invalid integer sizes. We've had a few cases of this previously, but I think this covers the remaining cases in GVN. Fixes microsoft#9040
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues remain; the only finding is a minor release-note label typo.
1 open issue
What changed in this PR
Prevents GVN load forwarding from generating unsupported DXIL integer types, addressing #9040.
Changes:
- Checks integer widths and directly coerces equal-sized values.
- Adds regression tests for narrow and wide forwarding cases.
- Documents the compiler fix in release notes.
| File | Description |
|---|---|
| tools/clang/test/DXC/Passes/GVN/dxil_illegal_narrow_integer_size.ll | Tests narrow-width legality and valid forwarding. |
| tools/clang/test/DXC/Passes/GVN/dxil_illegal_integer_size.ll | Tests wide-vector forwarding and illegal intermediates. |
| lib/Transforms/Scalar/GVN.cpp | Guards coercions and avoids unnecessary integer intermediates. |
| docs/ReleaseNotes.md | Documents the GVN fix. |
Review effort: Balanced
Fixed issues related to GVN load forwarding, shader reflection, and optimizer crashes. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Damyan Pepper (damyanp)
approved these changes
Oct 18, 2026
This branch has not been deployed
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.

This change is a more complete set of checks to avoid GVN generating invalid integer sizes. We've had a few cases of this previously, but I think this covers the remaining cases in GVN.
Fixes #9040