-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C++: Remove some IndirectOperand and IndirectInstruction nodes
#11218
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
C++: Remove some IndirectOperand and IndirectInstruction nodes
#11218
Conversation
…d 'IndirectOperand' when the semantically identical value already exists in the IR.
…truction before we should pick the operand as the 'sink' in the call-target resolution recursion.
…he qualifier of a call (and not just when it's an argument of a call).
282cf2f to
0c7f57e
Compare
|
I've looked through the result changes on DCA: the Samate ones are all TPs, and the lost results on |
| predicate hasIndirectOperand(Operand op, int indirectionIndex) { | ||
| /** | ||
| * Holds if the `(operand, indirectionIndex)` columns should be | ||
| * assigned an `RawIndirectOperand` value. |
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.
Minor typo, should be a RawIndirectOperand
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.
Fixed in b8fab9a.
| predicate hasIndirectInstruction(Instruction instr, int indirectionIndex) { | ||
| /** | ||
| * Holds if the `(instr, indirectionIndex)` columns should be | ||
| * assigned an `RawIndirectInstruction` value. |
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.
Same here
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.
Fixed in b8fab9a.
| } | ||
|
|
||
| /** | ||
| * INTERNAL: Do not use. |
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.
Should this (and IndirectInstruction) go in DataFlowPrivate 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.
Good idea. I've done this in b8fab9a.
…direct-and-instruction-nodes
|
Looks like there's some failing tests for Coding Standards - we need to fix or accept those as well |
They're failing on the base branch already. There's a fairly lengthy process requires to change these tests, so we'll do those separately once the feature branch is ready to be merged in. |
|
oh, right. Does the same go for the CPP Language tests? |
The internal ones are the next ones I'll be picking up.
The process relatively straightforward, as we won't target the coding standards |
70a9e49
into
github:mathiasvp/replace-ast-with-ir-use-usedataflow
Consider the IR for this simple function:
this has the following IR:
Currently, we generate an SSA write to the
IndirectOperandof&:r5_1, and SSA then flows from that node to theIndirectOperandfor&:r6_2. Flow then continues from that node, through theLoadInstructionand into the IR operand0:r6_3.That's kinda unnecessary. Instead of flowing to these
IndirectOperand, we might as well just reuse the IR operands (and instructions) where appropriate. This is what this PR does. For the above example, that means thatIndirectOperand(&:r6_2)is represented by the0:r6_3operand node.Note that we still need the
IndirectOperands for things like:which require some non-trivial flow through indirect dataflow nodes in order to reach
*px.A nice side-effect of this (which is really why the real goal of this PR) is that our existing
InstructionBarrierGuardbarrier now works as expected on the feature branch (since the nodes you want to select are now backed by instructions and operands in most cases). This makes our existing barrier guard tests pass again 🎉Commit-by-commit review recommended!
I've checked the query result changes. They're all either: