[llvm-dev] [RFC] Introduce new call-site attribute
Reid Kleckner via llvm-dev
llvm-dev at lists.llvm.org
Thu Sep 2 11:44:57 PDT 2021
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/20210902/3ea5ab05/attachment.html>
More information about the llvm-dev
mailing list