-
Notifications
You must be signed in to change notification settings - Fork 664
spirv-fuzz: Refactor ForEachInstructionWithInstructionDescriptor #3714
Copy link
Copy link
Closed
Labels
component:fuzzerRelates to the spirv-fuzz toolRelates to the spirv-fuzz tool
Description
We've had an internal discussion on the fact that we might want to skip unreachable blocks in ForEachInstructionWithInstructionDescriptor. We could implement that with DominatorAnalysis but it might be too expensive to reinitialize it every time. The reason being is that we can potentially invalidate all analysis in the module on each iteration over the module's instructions in ForEachInstructionWithInstructionDescriptor.
Solutions:
- Use DFS. We would need to recompute this every time as well, though. Maybe there is a way to do this efficiently but
ForEachInstructionWithInstructionDescriptormight get more complicated than it has to be. - Prohibit any changes to the module in
ForEachInstructionWithInstructionDescriptor. I'm not sure how to enforce this rule. Making the method constant won't help here. We could probably copy all required instructions into a vector first and then apply the user's callback to those instructions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component:fuzzerRelates to the spirv-fuzz toolRelates to the spirv-fuzz tool