<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="moz-cite-prefix">On 8/20/20 2:45 PM, Leonard Chan wrote:<br>
</div>
<blockquote type="cite" cite="mid:CAOF0fNBbgbqhFvNZdK5Xwk9Y6bQtShNTAwun7g1eOcAi3DLRVw@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<p>Hi, Leonard,</p>
<p>What are the motivating use cases?</p>
<p> -Hal</p>
</blockquote>
<div>The immediate use case for us specifically would be a way
to explicitly request static PLT relocations. We rolled out
a new relocation for AArch64 (<a href="https://reviews.llvm.org/D81184" moz-do-not-send="true">R_AARCH64_PLT32</a>) which takes
the offset between the PLT entry for a function and some
other symbol. In IR, we can then explicitly request this
relocation with `pltentry(@function) - @global` and
distinguish it from `@function - @global` which may or may
not lower to R_AARCH64_PREL32 if both symbols are dso_local.
This is especially useful for the <a href="https://reviews.llvm.org/D72959" moz-do-not-send="true">relative vtables ABI</a> where we
can benefit in size by not having to emit dso_local stubs
for some functions.</div>
</div>
</div>
</blockquote>
<p><br>
</p>
<p>Okay. So the idea is that Clang and other frontends will emit
them directly as parts of certain constant expressions inside of
certain data structures (e.g., vtables). That makes sense.</p>
<p> -Hal<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:CAOF0fNBbgbqhFvNZdK5Xwk9Y6bQtShNTAwun7g1eOcAi3DLRVw@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote">
<div><br>
</div>
<div>In the general case, this just adds a way for
semantically representing PLT entries for functions and
would ideally add more "correctness". From an IR
perspective, users won't need to second-guess "what will
this function be lowered to".</div>
</div>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</body>
</html>