[PATCH] D70157: Align branches within 32-Byte boundary

Kan Shengchen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 17 00:28:52 PST 2019


skan added a comment.

In D70157#1786901 <https://reviews.llvm.org/D70157#1786901>, @reames wrote:

> Noting another issue we found in local testing (with an older version of this patch).  This interacts badly with the implicit exception mechanism in LLVM.  For that mechanism, we end up generating assembly which looks more or less like this:
> Ltmp:
>
>   cmp %rsi, (%rdi)
>   jcc <target>
>   
>
> And a side table which maps TLmp to another label so that a fault at Ltmp can be interpreted as an extremely expensive branch via signal handler.
>
> The problem is that the auto-alignment of the fused branch causes padding to be introduced which separate the label and the faulting exception, breaking the mapping.
>
> Essentially, this comes down to an implicit assumption that the label stays tightly bundled with the following instruction.
>
> This can happen with either nop or prefix padding.


How about insert NOP before the label `Ltmp`?


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

https://reviews.llvm.org/D70157





More information about the cfe-commits mailing list