[PATCH] D97982: [MC] Introduce NeverAlign fragment type

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 17:57:28 PDT 2021


Amir added a comment.

@efriedma:

> That looks really fragile: it's depending on subtle details of the way the LastValidFragment cache works. I'd like to ensure the interaction here is more obviously correct.

NeverAlign functionality doesn't depend on the details of valid fragment caching. I've followed the debugger a bit more thoughtfully and I see that NeverAlign's fragment size is being updated on a relaxation of subsequent fragment here in `MCAsmLayout::layoutFragment`: https://github.com/llvm/llvm-project/blob/main/llvm/lib/MC/MCAssembler.cpp#L412.

As a big picture: we're trying to avoid using relaxation at all costs, because macro-op fusion alignment fragments are inserted before every eligible cmp+jcc fragment, which is pretty much every basic block. It's known to significantly increase layout time for us. It's easier to reason about this padding in terms of relaxation, but if it can be avoided, it should be, for practical reasons.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97982



More information about the llvm-commits mailing list