Skip to content

[SandboxIR][Tracker] Track creation of instructions #102013

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

Merged
merged 1 commit into from
Aug 5, 2024
Merged

Conversation

vporpo
Copy link
Contributor

@vporpo vporpo commented Aug 5, 2024

This patch adds tracking support for the creation of SandboxIR instructions. This allows us to undo the creation of instructions during revert().

Please note that we don't allow creation of detached instructions, meaning that the instructions need to be inserted into a block upon creation. This is why the tracker class combines creation and insertion.

Copy link
Contributor

@aeubanks aeubanks left a comment

Choose a reason for hiding this comment

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

could you add the note in the commit description as a comment somewhere in the code?

// Track creation of instructions.
auto &Tracker = getTracker();
if (Tracker.isTracking() && isa<Instruction>(VPtr.get()))
Tracker.track(std::make_unique<CreateAndInsertInst>(
Copy link

Choose a reason for hiding this comment

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

verbose version with dyn_cast instead of isa+cast

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

This patch adds tracking support for the creation of SandboxIR instructions.
This allows us to undo the creation of instructions during revert().

Please note that we don't allow the creation of detached instructions,
meaning that the instructions need to be inserted into a block upon creation.
This is why the tracker class combines creation and insertion.
@vporpo
Copy link
Contributor Author

vporpo commented Aug 5, 2024

could you add the note in the commit description as a comment somewhere in the code?

I added the note in registerValue() just before the creation of the tracking object.

@vporpo vporpo merged commit 0959e58 into llvm:main Aug 5, 2024
4 of 7 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.

3 participants