[llvm] r196334 - [Stackmap] Emit multi-byte nops for X86.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Dec 3 19:24:48 PST 2013


On 3 December 2013 19:49, Juergen Ributzka <juergen at apple.com> wrote:
> The existing long nop support is only used to align code sections in the AsmBackend and directly emits the raw bytes into the object file.
> This implementation is on a higher level that works for MCAsmStreamer and MCObjectStreamer.

That is still a duplication, and a non trivial one given that
different CPUs have different nop preferences and the new code is
quiet a bit harder to test.

There is a similar issues with the CFI directives where we want to be
able to print assembly that works with older assemblers without
duplicating the logic in CodeGen.

I think this duplication could be fixed by adding emitNops method to
the Streamer interface. This code would just call that method. The
alignment implementation in the Object streamer would figure out how
many bytes it needs and call emitNops. That way all the logic about
which nops to use for which cpu would be in emitNops.

Cheers,
Rafael



More information about the llvm-commits mailing list