[PATCH] D150068: [X86][AsmParser] Refactor code in AsmParser

Sergei Barannikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 7 20:32:31 PDT 2023


barannikov88 added inline comments.


================
Comment at: llvm/lib/Target/X86/X86InstrAsmAlias.td:554
 
-/*  FIXME: This is disabled because the asm matcher is currently incapable of
- *  matching a fixed immediate like $1.
----------------
skan wrote:
> barannikov88 wrote:
> > I think this can be done by implementing `validateTargetOperandClass` for `MCK__36_1` ($1).
> > See how ARM does this.
> > 
> Thanks for the info! I added the comments to `optimizeShiftRotateWithImmediateOne`.
I tried to do what I suggested and it doesn't work for all cases.
The "short" variants should be matched first, but this is not always happening.
Currently there doesn't seem to be a way to force ordering between the variants.
(AsmOperandClass has SuperClasses field that guarantees partial ordering, but there is no explicit operand to attach the class to.)



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150068/new/

https://reviews.llvm.org/D150068



More information about the llvm-commits mailing list