[PATCH] D97268: [X86] Use correct padding when in 16-bit mode

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 13:21:03 PST 2021


void added a comment.

In D97268#2584819 <https://reviews.llvm.org/D97268#2584819>, @jyknight wrote:

> In D97268#2583366 <https://reviews.llvm.org/D97268#2583366>, @void wrote:
>
>> That...shouldn't matter since a NOP is a NOP. Regardless, I removed that modification to simplify the patch.
>
> It _does_ matter. To start with it can affect performance (marginally).
>
> But more importantly, if you're doing tricky things with runtime code modification, it's a correctness issue. A trap won't leave the instruction pointer in the middle of a long-nop instruction (which you may be about to replace with another instruction), but it can leave it between two distinct nops.

I argue that because gas is comfortable with it it's most likely a non-issue. Especially since you can't guarantee that a sequence of nops will always be one instruction long. But like I said I reverted that bit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97268



More information about the llvm-commits mailing list