[PATCH] D76286: [X86][MC] Support enhanced relaxation for branch align

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 16:10:39 PDT 2020


reames requested changes to this revision.
reames added a comment.
This revision now requires changes to proceed.

I don't think is a good idea.  Without evidence to the contrary, I would assume that this suffers from exactly the same memory overhead problems as the original rejected patch.  The basic challenge is that a MCInst is quite large (~144 bytes if my quick mental math is right).  And the containing RelaxableInst is a bit larger still.  The storage for a small encoded instruction in a DataFragment without fixups is ~2-6 bytes.  That's a huge difference.

An alternate approach is to explore allowing prefixes to be spliced into DataFragments.  This would require keeping something analogous to a Fixup with the offset, prefix, and maximum bytes to insert.

Another idea would be a new fragment subclass for instructions which are paddable, but not relaxable.  Or possibly a compressed representation for RelaxableFragment (i.e. most of the space/generality appears to be overkill.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76286/new/

https://reviews.llvm.org/D76286





More information about the llvm-commits mailing list