Added support for multiple OperandConstraint::Reuse operands. #179
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.
Previously instructions that have multiple operands specifying the constraint
OperandConstraint::Reuse
would not work properly. Good examples of this are X86'sXCHG
andXADD
, both of which require twoOperandConstraint::Reuse
s. This PR addresses this issue and fixes it by using aSmallVec<[VReg; 4]>
to store all reuse constraints to check, instead of a singleOption<VReg>
.I ran 8 instances of ion_checker overnight without fail. Additionally, the fixes have enabled my compiler to correctly emit the aforementioned instructions and it passes my own test suite. I'm not however confident that the ion_checker correctly generates these types of instructions as prior to this change it was still reporting no errors. It also seems to only generate one Def per instruction.
I will be leaving a comment in #145 as I discovered some interesting things about that as well while looking into this.