Skip to content
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

cfg: reuse original ControlRegions as much as possible during structurization. #55

Merged
merged 5 commits into from
Jan 31, 2024

Conversation

eddyb
Copy link
Contributor

@eddyb eddyb commented Dec 21, 2023

Original motivation back when I first started this refactor was this bug:

Progress stalled back then and I only revived the branch for the Vulkan layer (#53), because trying to run the Vulkan CTS with the SPIR-T layer would run into:

  • missing OpSpecConstantOp support (already implemented in the Vulkan layer branch)
  • structurizer region desync list_eq_key panics (fixed by this PR)
  • missing OpTypeForwardPointer support (not implemented yet, but it's much rarer and only used with PhysicalStorageBuffer pointers, since logical pointers don't allow recursive data types in the first place)

On top of unblocking the SPIR-T Vulkan layer for in-depth testing, this refactor, out of necessity of not introducing even more spurious unused bools, makes the existing ones as lazy as possible (within the limits of what the structurizer knows without adding more analysis passes).

You can see in the README.md example, that this PR removes both extraneous bools (for "does break" vs "doesn't break"), and instead the original condition (v2) is now used directly by the loop.

I've also theoretically come up with even more advanced techniques (such as taking N disjoint targets that can be dispatched all at once, and lazily generating the appropriate propagation of integer values 0..N to use a switch), but they either require other PRs to land as well first, and/or are too invasive and this has already been a ridiculous sunken cost compared to the measely benefits it offers.

@fornwall fornwall marked this pull request as ready for review January 31, 2024 12:42
@fornwall fornwall self-requested a review January 31, 2024 12:42
Copy link
Contributor Author

@eddyb eddyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just did a once-over, this seems ready to land, just needs CHANGELOG (heh @fornwall beat me to it).

fornwall
fornwall previously approved these changes Jan 31, 2024
fornwall
fornwall previously approved these changes Jan 31, 2024
@fornwall fornwall added this pull request to the merge queue Jan 31, 2024
@eddyb eddyb removed this pull request from the merge queue due to a manual request Jan 31, 2024
@github-merge-queue github-merge-queue bot dismissed fornwall’s stale review January 31, 2024 13:54

The merge-base changed after approval.

@eddyb eddyb marked this pull request as draft January 31, 2024 14:22
@eddyb eddyb marked this pull request as ready for review January 31, 2024 14:42
@fornwall fornwall self-requested a review January 31, 2024 14:46
@fornwall fornwall added this pull request to the merge queue Jan 31, 2024
Merged via the queue into main with commit 36b3d33 Jan 31, 2024
6 checks passed
@fornwall fornwall deleted the structurize-keep-regions branch January 31, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants