-
Notifications
You must be signed in to change notification settings - Fork 691
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
Fix RemoveUnstructuredLoopExits when an exiting edge jumps out multiple levels of loops. #6668
Conversation
e62783e
to
55338e7
Compare
yeah, I need to fix this. I thought I was running with ASAN but I wasn't. |
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.
LGTM, thanks for the fix!
I appreciate the comments and level of detail. A totally optional suggestion would be to add some ascii art to the test or comment to clarify the situation. Sometimes a picture can really help the understanding.
Indeed pictures are great. I've added ASCII art depictions of the CFGs for the two reduced test cases. The "regression" case is a mess, and doesn't provide extra insight. |
The failures are weird; I can't explain them by this change. An error is caused by this warning (with warnings-as-error):
The source at that spot has a pragma that appears to guard the warning. I'll try a no-change amend commit to kick off the bots again. |
…le levels of loops Before doing any major surgery on an exit from loop L, ensure that if an exit edge from L goes to block X, then X is in L's parent loop or no loop at all. Add test cases: - a reduced test case where the exiting block does not dominate its own loop latch. - a reduced test case where the exiting block is the latch for its own loop. This reproduces the assert triggered by the original HLSL. - the original HLSL that triggered this bug fix. - the intermediate module from the original HLSL, taken just before the attempt to remove unstructured loop exits.
Trying again by rebasing against latest main. |
The Windows build failures here seem to be related to a VM image update that occurred last night. Our builds work fine on VM image 20240514.3.0, and fail on 20240603.1.0. Given that I'm fairly confident this PR isn't related to the issues I'm going to bypass the merge checks to merge the PR. |
We do not want this change to stick around forever but we need it to work around the broken GitHub runner images: actions/runner-images#10004 Related microsoft#6668
…t multiple levels of loops. (microsoft#6668)" This reverts commit 8206fbd. Reason for revert: since landing this, new asserts/crashes have been found.
This PR contains two changes: 1) Moves a pragma to disable a warning, which seems to be required by the new compiler. 2) Adds a preprocessor define to workaround the crashes caused by the runner image mismatching C++ runtime versions. The second change we will want to revert once the runner images are fixed. The issue tracking the runner images is: actions/runner-images#10004 Related #6668
…t multiple levels of loops. (microsoft#6668)" This reverts commit 8206fbd. Reason for revert: since landing this, new asserts/crashes have been found.
This PR contains two changes: 1) Moves a pragma to disable a warning, which seems to be required by the new compiler. 2) Adds a preprocessor define to workaround the crashes caused by the runner image mismatching C++ runtime versions. The second change we will want to revert once the runner images are fixed. The issue tracking the runner images is: actions/runner-images#10004 Related microsoft#6668 (cherry picked from commit 0b9acdb)
Before doing any major surgery on an exit from loop L, ensure that if an exit edge from L goes to block X, then X is in L's parent loop or no loop at all.
Add test cases: