-
Notifications
You must be signed in to change notification settings - Fork 640
spirv-opt: Add a folding rule for OpBitReverse.
#6321
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
Conversation
s-perron
left a comment
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.
The implementation looks good, but it could use more tests. Just to have a little more coverage in case someone decides to change it.
OpBitReverse.OpBitReverse.
Thank you, I added more test cases and modified the folding logic to handle null constants |
bcc5fa2 to
d6c3793
Compare
80ba27d to
763fa08
Compare
s-perron
left a comment
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 think this look good now. You can merge when you think it is ready.
|
Thank you for the thorough review, will merge now. |
Add a folding rule for
OpBitReverseon scalar and vector types.Noticed we are missing this optimization while working on microsoft/DirectXShaderCompiler#7680
Additionally, fix various constant folding errors for
OpBitCastto handle null constants as well as lower-bit to higher-bit integer conversions. Previously, it was throwing error for e.g.OpBitcast %int %v2ushort_1_null.