[PATCH] D97982: [MC] Introduce NeverAlign fragment type
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 14 15:48:32 PDT 2021
efriedma added a comment.
In D97982#2818213 <https://reviews.llvm.org/D97982#2818213>, @Amir wrote:
> In D97982#2811315 <https://reviews.llvm.org/D97982#2811315>, @efriedma wrote:
>
>>> Which disables NeverAlign padding (0 bytes)
>>
>> When do we actually do this computation? At first glance, MCAssembler::layoutSectionOnce never actually goes back to recompute the size of the NeverAlign padding.
>
> So it's the case that layoutSectionOnce/layoutOnce actually recomputes the size of the NeverAlign padding indirectly:
>
> Inside layoutSectionOnce, when it relaxes the fragment (relaxFragment), if the fragment is FT_Relaxable, it calls relaxInstruction, which in turn checks fragmentNeedsRelaxation for the passed fragment F, which then goes over F->getFixups, calling evaluateFixup, and so on through Layout.getSymbolOffset(Sym) and Layout.getFragmentOffset, inside the ensureValid check, calls layoutFragment, which then computes fragment size (computeFragmentSize):
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.
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