C++: Remove some IndirectOperand and IndirectInstruction nodes
#11218
+454
∄1�7334
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
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 againCommit-by-commit review recommended!
I've checked the query result changes. They're all either: