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

Make Visitor more robust on instruction iteration #79

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

xuechen417
Copy link
Contributor

Use a fixed end guard for the instruction iteration is not robust for callbacks to add a basic block. Use Instruction::getNextNode() for the iteration to allow callbacks to directly edit the code.

Copy link
Member

@nhaehnle nhaehnle left a comment

Choose a reason for hiding this comment

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

Thanks! That said, the previous code allowed the callback function to erase the given instruction (that's why it has the make_early_inc_range). So using getNextNode must happen before the call to visit.

Also, please fix the typo in the title: Visitor

@xuechen417 xuechen417 changed the title Make Vistor more robust on instruction iteration Make Visitor more robust on instruction iteration Jan 15, 2024
Use a fixed end guard for the instruction iteration is not robust for
callbacks to add a basic block. Use `Instruction::getNextNode()` for the
iteration to allow callbacks to directly edit the code.
@xuechen417
Copy link
Contributor Author

Move getNextNode before calling visit

@xuechen417
Copy link
Contributor Author

ping for review

Copy link
Member

@nhaehnle nhaehnle left a comment

Choose a reason for hiding this comment

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

Thanks!

@xuechen417 xuechen417 merged commit 69e114f into GPUOpen-Drivers:dev Jan 19, 2024
8 checks passed
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