The visitor functions for Region and Block types did not always
check the value returned by recursive calls. This caused the top-level
visitor invocation to return WalkResult::advance() even if one or more
recursive invocations returned WalkResult::interrupt(). This patch
fixes the problem by check if any recursive call is interrupted, and if
so, return WalkResult::interrupt().
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for the contribution! It looks good to me.
This patch doesn't add unit tests since our test framework
(TestGenericIRVisitorInterruptPass) invokes visitor functions for
operations but not for regions and blocks.
I think it's important that we test this. Would it possible to add a new visitor for regions and blocks?
I think it's important that we test this. Would it possible to add a new visitor for regions and blocks?
Thanks, that makes sense. I've added visitor functions for regions and blocks. However, BlockArguments cannot have attributes (which we use to decide whether to interrupt the walk), so the visitor function for blocks skips iterating over its argument.
Same comment here as below.