[llvm] r190773 - Implement function prefix data as an IR feature.
Peter Collingbourne
peter at pcc.me.uk
Mon Sep 23 13:18:12 PDT 2013
On Mon, Sep 23, 2013 at 03:41:39PM -0400, Sean Silva wrote:
> +A trivial example of valid prefix data for the x86 architecture is ``i8
> 144``,
> +which encodes the ``nop`` instruction:
> +
> +.. code-block:: llvm
> +
> + define void @f() prefix i8 144 { ... }
> +
> +Generally prefix data can be formed by encoding a relative branch
> instruction
> +which skips the metadata, as in this example of valid prefix data for the
> +x86_64 architecture, where the first two bytes encode ``jmp .+10``:
> +
> +.. code-block:: llvm
> +
> + %0 = type <{ i8, i8, i8* }>
> +
> + define void @f() prefix %0 <{ i8 235, i8 8, i8* @md}> { ... }
> +
> +A function may have prefix data but no body. This has similar semantics
> +to the ``available_externally`` linkage in that the data may be used by the
> +optimizers but will not be emitted in the object file.
> +
>
> Can you be a bit more explicit about the endianness/layout of the emitted
> data?
I've added a paragraph on this in r191219.
Thanks,
--
Peter
More information about the llvm-commits
mailing list