<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - LTO uses incomplete/inaccurate libcall list"
href="https://bugs.llvm.org/show_bug.cgi?id=44353">44353</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>LTO uses incomplete/inaccurate libcall list
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>ELF
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>sbc@chromium.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org
</td>
</tr></table>
<p>
<div>
<pre>I recently added support for handling libcalls generated at LTO time to
wasm-ld:<a href="https://reviews.llvm.org/D71738">https://reviews.llvm.org/D71738</a>.
I noticed that LTO this relies on the static list of libcalls listed in
llvm/include/llvm/IR/RuntimeLibcalls.def.
See lto::LTO::getRuntimeLibcallSymbols.
However as it says in the comments in RuntimeLibcalls.def:
```
Some libcalls have different names on particular OSes or architectures.
These are set in InitLibcallNames() in TargetLoweringBase.cpp and/or by targets
using TargetLoweringBase::setLibcallName()
```
For example in WebAssembly backend has the following code which means that this
mechnism doesn't work for the FPROUND_F32_F16 libcall:
setLibcallName(RTLIB::FPROUND_F32_F16, "__truncsfhf2");
Possible solutions:
1. Create a hard-coded list of all libcall renames/aliases and add that to
lto::LTO::getRuntimeLibcallSymbols. Would be fragile.
2. Extract the names after the renaming has been done. See
TargetLoweringBase::InitLibcalls.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>