The motivation behind this change is to make fixing this (and other issues like this that may crop up in the future) easier.
This is _almost_ NFC, but there are some notable changes here:
- isMetaInstruction() is used directly instead of checking for specific meta-instructions like IMPLICIT_DEF or KILL. This was already the case in RISCV, but other architectures still did hardcoded checks.
- As an exception to this, CFI instructions are explicitly delegated to the target because RISCV has different handling for those.
- isTargetIndex() checks are replaced with an assert; none of the architectures supported actually use MO_TargetIndex at this point in time, but just removing this check may trip someone up down the line.
- isCFIIndex() and isFI() checks are also replaced with asserts, since these operands should not exist in any context at this stage in the pipeline.