[llvm-dev] Question regarding the number of operands in MCInst

Min-Yih Hsu via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 14 14:48:15 PDT 2021


Hi All,

I have a simple question regarding the number of operands in MCInst:
Given a MCInst that is not variadic and does not have any implicit use/def operand. Does the number of its operands _always_ match the number of operands described in its MCInstrDesc counterpart?

More specifically, `MCID` is the MCInstrDesc object of a MCInst `MCI`, is the following statement always true?
```
MCID.getNumOperands() == MI.getNumOperands() ||
MCID.isVariadic() ||
MCID.getNumImplicitUses() || MCID.getNumImplicitDefs()
```
Is there any chances where a MCInst has more/less operands than its MCInstrDesc (other than variadic and implicit operands)?

Thank you!
-Min


More information about the llvm-dev mailing list