[llvm-dev] [RFC] Introduce new call-site attribute

Evgueni Brevnov via llvm-dev llvm-dev at lists.llvm.org
Fri Sep 3 06:35:52 PDT 2021


Thank you guys for the input.
Being able to specify arbitrary range (relative or absolute) makes
perfect sense to me. As for the format I would propose to simply use the
same as absolute_symbol
<https://llvm.org/docs/LangRef.html#absolute-symbol-metadata>.


On Fri, Sep 3, 2021 at 1:45 AM Reid Kleckner <rnk at google.com> wrote:

> On Wed, Sep 1, 2021 at 5:49 PM Philip Reames via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> All of the above is a really involved way of saving that I think you need
>> to change your spelling on the attribute a bit.  I think we need to be able
>> to support fairly arbitrary restrictions on the relative range, and then
>> leave it up to the code generator which option it actually picks.  As a
>> strawman, how about the following syntax:
>>
>> call void @foo() target-address-relative-bound(-2147483648
>> <(214)%20748-3648>, 2147483647 <(214)%20748-3647>)
>>
>> OR
>>
>> declare void @foo() address-absolute-bound(X, X + 100MB)
>>
>> I agree, this makes sense to me. My bikeshedding suggestion is to store
> the offsets in log2 form. Something like "target-pc-rel"(32) ,
> "target-pc-rel"(12), "target-pc-abs"(32). This should generalize from X86
> to ARM/AArch64 and other ISAs with shorter displacements. Later you could
> imagine throwing in other relocation variants like "tocrel", "gotrel", or
> anything you need for your particular architecture.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210903/63d37fd3/attachment.html>


More information about the llvm-dev mailing list