-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[SandboxIR][NFC] GenericSetter tracker class #102260
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
Conversation
llvm/lib/SandboxIR/SandboxIR.cpp
Outdated
@@ -687,7 +689,10 @@ void LoadInst::dump() const { | |||
void StoreInst::setVolatile(bool V) { | |||
auto &Tracker = Ctx.getTracker(); | |||
if (Tracker.isTracking()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might even be able to factor out if (Tracker.isTracking())
somehow with another helper method. but maybe that's not good for consistency with the other trackers that don't use GenericSetter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I am not sure I follow how this could be done. Could you elaborate?
Perhaps we could move the isTracking()
check inside track()
and have it create the object internally instead of having to create the object with make_unique
and passing it as an argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, something like that. The part about it conditionally creating the object internally is the tricky part.
@@ -687,7 +689,10 @@ void LoadInst::dump() const { | |||
void StoreInst::setVolatile(bool V) { | |||
auto &Tracker = Ctx.getTracker(); | |||
if (Tracker.isTracking()) | |||
Tracker.track(std::make_unique<SetVolatile>(this, Tracker)); | |||
Tracker.track( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multi-line ifs should have braces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the ones related to this patch, but there are plenty more. I will fix them separately.
This patch introduces the `GenericSetter` tracker class that can be used to track and revert simple instruction setters. This patch also replaces several setter tracker classes with the generic one.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/23/builds/1735 Here is the relevant piece of the build log for the reference:
|
…38fbc60f8 Local branch amd-gfx 5fa38fb [AMDGPU] Extend virtual register use to redefined strict WQM registers Remote branch main 4fe33d0 [SandboxIR][NFC] GenericSetter tracker class (llvm#102260)
This patch introduces the
GenericSetter
tracker class that can be used to track and revert simple instruction setters.This patch also replaces several setter tracker classes with the generic one.