C++: Fix more asExpr
duplication
#15458
Merged
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.
Suggestion cannot be applied right now. Please check back later.
When we check for whether an instruction represents the "fully converted expression" we ask for the expression associated with the instruction, and require that no "later" instruction associated with the same expression exists. This last part is done via the integer
n
in the charpred that looks like:However, it may actually be the case that one instruction is associated with one conversion of an instruction, but a later instruction is associated with another conversion of the same expression. To account for this, instead of requiring that there doesn't exist another instruction with a larger
n
and the same instruction, we ask whether there exists an instruction with a largern
and a conversion of the same unconverted instruction. That is, we now do:and this fixes the remaining dataflow node duplication in our
asExpr
tests 🎉