[llvm] [MC][X86] Avoid copying MCInst in emitInstrEnd (PR #94947)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 19:42:06 PDT 2024


================
@@ -267,8 +268,8 @@ static bool isRIPRelative(const MCInst &MI, const MCInstrInfo &MCII) {
 }
 
 /// Check if the instruction is a prefix.
-static bool isPrefix(const MCInst &MI, const MCInstrInfo &MCII) {
-  return X86II::isPrefix(MCII.get(MI.getOpcode()).TSFlags);
+static bool isPrefix(unsigned Opcode, const MCInstrInfo &MCII) {
----------------
topperc wrote:

I think it's for this line in `X86AsmBackend::canPadInst`

```
if (isPrefix(PrevInstOpcode, *MCII))
```

https://github.com/llvm/llvm-project/pull/94947


More information about the llvm-commits mailing list