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

Philip Reames via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 16 15:47:34 PST 2019


reames added a comment.

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.


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

https://reviews.llvm.org/D70157





More information about the cfe-commits mailing list