Skip to content

Conversation

@bob80905
Copy link
Collaborator

Previously, there would be no recursion validation performed on any function declarations in library shaders. This PR adds code that validates that no function declarations that are found inside library shaders are recursive. The diagnostics aren't repeated, since there's logic to prevent the same diagnostic from being emitted by 2 similar ancestors of the same recursive function. The PR also adjusts recursion detection for shaders in non-library cases, and improves the original diagnostic by adding information about the name of the function that is recursive. The PR is meant to complete the work on issue #5789. However, more work needs to be done for full accuracy.
The PR checks all function declarations in the translation unit for the library shader case, when it should really only be checking a subset of function declarations. This issue is filed here: #5857
Fixes #5789

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@bob80905 bob80905 force-pushed the recursive_functions_in_shader branch from 45388fb to 006e78e Compare October 12, 2023 05:05
@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@bob80905
Copy link
Collaborator Author

The new "CheckReachability" function is unused, but was helpful during iteration, and satisfies the description of the CallGraphWithRecurseGuard class. The class advertised that checking for reachability efficiently was one feature that was provided, but there isn't a function to do that explicitly, so I figured I'd add the function here.

Copy link
Collaborator

@pow2clk pow2clk left a comment

Choose a reason for hiding this comment

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

Looks like the right direction! I think too much effort was made to keep the patch constant function special in the output. I think eliminating that requirement will simplify a lot.

Copy link
Collaborator

@pow2clk pow2clk left a comment

Choose a reason for hiding this comment

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

Merp. I concur with the comments that Chris made that I've thumbed. I have some pushback on at least one, I'm not prepared to approve just yet if only because I think Chris had some good points.

Thanks for the responses to my earlier comments!

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Collaborator

@llvm-beanz llvm-beanz left a comment

Choose a reason for hiding this comment

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

I had one small comment, but otherwise this looks good.

Copy link
Collaborator

@pow2clk pow2clk left a comment

Choose a reason for hiding this comment

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

I think some of Chris's comments still need addressing, but I'm satisfied with what's here

Copy link
Collaborator

@pow2clk pow2clk left a comment

Choose a reason for hiding this comment

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

I just noticed that a lot of the end-to-end filecheck tests seem like they could be SemaHLSL verifier tests. Did you consider that?

@bob80905 bob80905 merged commit cd03365 into microsoft:staging-sm-6.8 Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants