Repository navigation
spirv-opt: Keep ids used by OpMemberDecorateIdEXT live in ADCE - #6996
Closed
apollo-2006 wants to merge 1 commit into
Closed
apollo-2006 wants to merge 1 commit into
apollo-2006 wants to merge 1 commit into
Conversation
The decoration manager did not register OpMemberDecorateIdEXT, and ADCE
only kept the id operands of OpDecorateId live. So for
OpMemberDecorateIdEXT %Heap 0 OffsetIdEXT %offset
ADCE removed %offset but kept the decoration, and the output failed
validation with "The following forward referenced IDs have not been
defined". All of glslang's descriptor heap tests that use OffsetIdEXT
hit this under -O, -Os and --legalize-hlsl.
Register OpMemberDecorateIdEXT in the decoration manager, keep its id
operand live in ADCE, and remove it when its target is dead.
Collaborator
|
Thanks for the contribution. Sorry I didn't get to it sooner. #7021 does this too, and handle another pass as well. I will close this PR in favour of the other. |
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.
ADCE drops constants that are only used by
OpMemberDecorateIdEXTbut keeps the decoration itself. So with%offsetis gone while the decoration still points at it, and the output fails withThe following forward referenced IDs have not been defined. Six of glslang’s descriptor heap tests hit this under-O,-Osand--legalize-hlsl.The decoration manager never registered
OpMemberDecorateIdEXT, and ADCE only keptOpDecorateIdoperands live. Now it’s registered, ADCE keeps its id operand live like it does forOpDecorateId, and it’s removed when its target is dead, likeOpMemberDecorate. The type manager still ignores it.I added two ADCE tests, one with a live target and one with a dead one. test_opt passes on release and debug, and those six heap tests come out valid now. If you’d rather handle it another way, let me know :)