[llvm] MC: Store MCRelaxableFragment MCInst out-of-line (PR #147229)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 21:29:31 PDT 2025


================
@@ -881,6 +882,8 @@ bool MCAssembler::relaxInstruction(MCRelaxableFragment &F) {
 
   ++stats::RelaxedInstructions;
 
+  // TODO Refactor relaxInstruction to accept MCRelaxableFragment and remove
+  // `setInst`.
   MCInst Relaxed = F.getInst();
   getBackend().relaxInstruction(Relaxed, *F.getSubtargetInfo());
----------------
MaskRay wrote:

The `MCInst` representation is too large to ever support more than one instruction. I plan to refactor MCFragment to contain a fixed and a variable part (e.g., a span-dependent instruction), and delete all MCFragment subclasses. With the end state, encoding multiple instructions might become feasible.

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


More information about the llvm-commits mailing list