[llvm] [ARM][TableGen][MC] Change the ARM mnemonic operands to be optional for ASM parsing (PR #83436)
Ivan Kosarev via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 04:51:20 PST 2024
================
@@ -608,12 +627,19 @@ struct MatchableInfo {
void buildInstructionResultOperands();
void buildAliasResultOperands(bool AliasConstraintsAreChecked);
- /// operator< - Compare two matchables.
- bool operator<(const MatchableInfo &RHS) const {
+ /// comp - Compare two matchables.
+ bool comp(const MatchableInfo &RHS, const CodeGenTarget &Target) const {
// The primary comparator is the instruction mnemonic.
if (int Cmp = Mnemonic.compare_insensitive(RHS.Mnemonic))
return Cmp == -1;
+ // Sort by the resultant instuctions size, eg. for ARM instructions
+ // we must choose the smallest matching instruction.
+ if (Target.getSortBySize()) {
+ if (ResInstSize != RHS.ResInstSize)
----------------
kosarev wrote:
Can be a single `if`. +Same below.
https://github.com/llvm/llvm-project/pull/83436
More information about the llvm-commits
mailing list