Skip to content

Commit 4f7f51c

Browse files
committed
[SPIRV] Use a worklist in the post-legalizer
This commit refactors the SPIRV post-legalizer to use a worklist to process new instructions. Previously, the post-legalizer would iterate through all instructions and try to assign types. This could fail if a new instruction depended on another new instruction that had not been processed yet. The new implementation adds all new instructions that require a SPIR-V type to a worklist. It then iteratively processes the worklist until it is empty. This ensures that all dependencies are met before an instruction is processed. This change makes the post-legalizer more robust and fixes potential ordering issues with newly generated instructions. Existing tests cover existing functionality. More tests will be added as the legalizer is modified. Part of #153091
1 parent a50d036 commit 4f7f51c

File tree

1 file changed

+319
-67
lines changed

1 file changed

+319
-67
lines changed

0 commit comments

Comments
 (0)