-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[SandboxIR] Add setOperand() and RAUW,RUWIf,RUOW #98410
Conversation
@@ -303,6 +309,13 @@ class Value { | |||
#endif | |||
}; | |||
|
|||
/// Helper Attorney-Client class that gives access to the underlying IR. |
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.
Could the ValueAttorney
be in the cpp file? It is kind of a public loop hole.
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.
It will only give access to the LLVM Value to its friends, so I don't see how it is a loop hole.
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.
can we add friend class User;
in Value
instead?
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.
Yes we can, and in this case it makes sense to use a friend because the User class is expected to be tightly coupled to the Value class. But for classes that are not as closely related to the IR, like the transaction tracker, it is nicer to use a client-attorney class to restrict access to just the LLVM Value and nothing else. Anyway, I will remove it for now and add it in later.
@@ -303,6 +309,13 @@ class Value { | |||
#endif | |||
}; | |||
|
|||
/// Helper Attorney-Client class that gives access to the underlying IR. |
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.
can we add friend class User;
in Value
instead?
This patch adds the following member functions: - User::setOperand() - User::replaceUsesOfWith() - Value::replaceAllUsesWith() - Value::replaceUsesWithIf()
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.
lgtm with comments addressed
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 think I'd like to see the comments expanded in SandboxIR in general to talk about what aspects you need to handle specifically before delegating down to LLVM IR. Right now it's a little hard to tell what is part of the layer on top of LLVM IR and what's just a delegate.
As an example: the asserts in rauw are the same as in the delegate .
Ah yes, we have not added any of the transaction tracking code yet, so the IR will currently delegate everything down to LLVM IR. Once we add the tracking code all these functions that modify the IR's state, like RAUW, setOperand, moveBefore etc. will include code that tracks the state change. The first patches that will add some of this functionality are a couple of patches down the road. |
That makes sense. A next patch to add the "delegate for X work" comments
might be good just to make sure that the code is straightforward for
reviews. Thoughts?
…On Thu, Jul 11, 2024 at 2:15 PM vporpo ***@***.***> wrote:
Ah yes, we have not added any of the transaction tracking code yet, so the
IR will currently delegate everything down to LLVM IR. Once we add the
tracking code all these functions that modify the IR's state, like RAUW,
setOperand, moveBefore etc. will include code that tracks the state change.
The first patches that will add some of this functionality are a couple of
patches down the road.
—
Reply to this email directly, view it on GitHub
<#98410 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACP5DBBSM2MVBY4JYDZGVDZL3YVXAVCNFSM6AAAAABKV2YLJWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRTHE2TCNBRGA>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
OK I will update this patch with some comments and I will follow up with another one that adds these comments to the remaining functions. The assumption is that all SandboxIR functions with the same name as the corresponding LLVM IR function is almost always a delegate, but yeah clarifying that is always helpful. |
I will upload the additional comments in a separate patch. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/1401 Here is the relevant piece of the build log for the reference:
|
This patch adds the following member functions: - User::setOperand() - User::replaceUsesOfWith() - Value::replaceAllUsesWith() - Value::replaceUsesWithIf()
This patch adds the following member functions: