Skip to content

Conversation

@s-barannikov
Copy link
Contributor

@s-barannikov s-barannikov commented Feb 10, 2024

At some point in the past, optional operands have become allowed in the middle of an instruction. However, checkAsmTiedOperandConstrains hasn't been modified to support this. This patch adds the support by pulling operand offsets counting out of convertToMCInst and reusing it in checkAsmTiedOperandConstrains.

@github-actions
Copy link

github-actions bot commented Feb 10, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@s-barannikov
Copy link
Contributor Author

s-barannikov commented Feb 10, 2024

Attached is a readable diff (updated).
test.zip

@s-barannikov s-barannikov marked this pull request as draft February 10, 2024 22:07
@s-barannikov
Copy link
Contributor Author

I'll try to pull the duplicate logic to some common place. (I'll need to modify it in the next PR.)

@s-barannikov s-barannikov marked this pull request as ready for review February 10, 2024 22:39
At some point in the past, optional operands have become allowed in the
middle of an instruction. However, `checkAsmTiedOperandConstrains`
hasn't been modified to support this. This patch adds the support by
copying the necessary logic from `convertToMCInst`.
@s-barannikov s-barannikov force-pushed the asm-matcher-emitter/optional-operand-between-constrained branch from 0bd96c2 to a38f0a0 Compare February 18, 2024 14:25
@s-barannikov
Copy link
Contributor Author

ping

1 similar comment
@s-barannikov
Copy link
Contributor Author

ping

@AlfieRichardsArm
Copy link
Contributor

AlfieRichardsArm commented Feb 29, 2024

Ah very nice, presumably this fixes some of the issues I ran into, but looks like better solution than my hack.

@AlfieRichardsArm
Copy link
Contributor

If possible some extra comments about the logic behind the operand indices would be appreciated as the logic in this file is already pretty inexplicable. Other than that LGTM

Copy link
Contributor

@AlfieRichardsArm AlfieRichardsArm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@s-barannikov
Copy link
Contributor Author

If possible some extra comments about the logic behind the operand indices would be appreciated as the logic in this file is already pretty inexplicable.

Sure, I'll see what I can come up with.

@s-barannikov
Copy link
Contributor Author

@AlfieRichardsArm
I've added clarifying comments, please see if they help.

@AlfieRichardsArm
Copy link
Contributor

Looks great thank you

@s-barannikov s-barannikov merged commit 199bbe2 into llvm:main Mar 1, 2024
@s-barannikov s-barannikov deleted the asm-matcher-emitter/optional-operand-between-constrained branch March 1, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants