ATM, there are two kind of problems with thumb instructions (both cause assertion in InstrBuilder)
- Incorrect detection of variadic ops
Some thumb instructions (like tMOVSr) have less number of operands in their MCInstrDesc than MCInst.getNumOperands(). This makes llvm-mca beleive those are variadic, while they're not.
- Detcting more explicit defs than there actually are.
This happens because Thumb target defines CPSR (s_cc_out) as output operand (ARM target defines it as input),
Please don't rely on ThumbFrm, a lot of those flags are legacy and should be removed.
I was hoping that this wouldn't have to say "if (thumb)" anywhere, even if the instructions are a little odd. Can it check the position of the optional def instead? So it detects instructions like this, without having to be target dependent.