[PATCH] D129677: Disable machine function splitting for functions with inline asm br

Adrian Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 15:00:34 PDT 2022


adriantong1024 added a comment.

In D129677#3649869 <https://reviews.llvm.org/D129677#3649869>, @efriedma wrote:

>> In the inline assembly, there may be branch that can only jump a limited distance, if we run MFS on the function, the resulting distance maybe to far to encode into the instruction.
>
> If there's a rule like this, we should explicitly state in LangRef which branches are/are not allowed.



In D129677#3649883 <https://reviews.llvm.org/D129677#3649883>, @nickdesaulniers wrote:

> In D129677#3649869 <https://reviews.llvm.org/D129677#3649869>, @efriedma wrote:
>
>>> In the inline assembly, there may be branch that can only jump a limited distance, if we run MFS on the function, the resulting distance maybe to far to encode into the instruction.
>>
>> If there's a rule like this, we should explicitly state in LangRef which branches are/are not allowed.
>
> It also seems like such a case is easy to fix; in the inline asm the user should just use the wider encoding.
>
> Maybe would be a surprising failure though, since you'd think the labels are nearby.

@efriedma Thanks for the comment. Should it not be the compiler's job not to break valid inline assembly user put into their code ? or this is where we should have a specification to tell the user to not assume the block to be very close by.
@nickdesaulniers Thanks for the comment. I agree this does not happen much. but in case of machine function splitting, I do see it happening once in one of our workloads. The cold blocks are relocated too far.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129677



More information about the llvm-commits mailing list