<html>
<head>
<base href="http://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 - GlobalISel AArch64: s16 FPR: Assertion failed: (OrigTy.getSizeInBits() == NewTy.getSizeInBits() && "Types with difference size cannot be handled by the default " "mapping")"
href="http://bugs.llvm.org/show_bug.cgi?id=32560">32560</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>GlobalISel AArch64: s16 FPR: Assertion failed: (OrigTy.getSizeInBits() == NewTy.getSizeInBits() && "Types with difference size cannot be handled by the default " "mapping")
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>GlobalISel
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ahmed.bougacha@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>This:
define void @f(float %a, half* %p) {
%tmp0 = fptrunc float %a to half
store half %tmp0, half* %p
ret void
}
crashes regbankselect, with:
Assertion failed: (OrigTy.getSizeInBits() == NewTy.getSizeInBits() && "Types
with difference size cannot be handled by the default " "mapping"), function
applyDefaultMapping
0 clang-5.0 0x0000000102bd129c
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 60
1 clang-5.0 0x0000000102bd1819
PrintStackTraceSignalHandler(void*) + 25
2 clang-5.0 0x0000000102bcd6a9 llvm::sys::RunSignalHandlers() +
425
3 clang-5.0 0x0000000102bd1c92 SignalHandler(int) + 354
4 libsystem_platform.dylib 0x00007fffc9605b3a _sigtramp + 26
5 clang-5.0 0x00000001078a9730 char const*
parse_block_invoke<(anonymous namespace)::Db>(char const*, char const*,
(anonymous namespace)::Db&)::test + 56928
6 libsystem_c.dylib 0x00007fffc948a420 abort + 129
7 libsystem_c.dylib 0x00007fffc9451893 basename_r + 0
8 clang-5.0 0x0000000103d63f39
llvm::RegisterBankInfo::applyDefaultMapping(llvm::RegisterBankInfo::OperandsMapper
const&) + 1401
9 clang-5.0 0x0000000103d54c81
llvm::RegisterBankInfo::applyMapping(llvm::RegisterBankInfo::OperandsMapper
const&) const + 65
10 clang-5.0 0x0000000103d54bcb
llvm::RegBankSelect::applyMapping(llvm::MachineInstr&,
llvm::RegisterBankInfo::InstructionMapping const&,
llvm::SmallVectorImpl<llvm::RegBankSelect::RepairingPlacement>&) + 987
11 clang-5.0 0x0000000103d55030
llvm::RegBankSelect::assignInstr(llvm::MachineInstr&) + 880
12 clang-5.0 0x0000000103d5579d
llvm::RegBankSelect::runOnMachineFunction(llvm::MachineFunction&) + 1629
13 clang-5.0 0x0000000101baf0d1
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 449
Because we don't support 16-bit mappings in FPR, so we try to map the G_STORE
to GPR, but end up with a 32-bit mapping (because there is no GPR16 mapping).
If we have to create a COPY to satisfy bank constraints (because the vreg we're
using was mapped to FPR earlier), we later fail when creating the COPY to apply
the mapping, as we're confused that an s32 mapping would have an s16 type.
We could relax the assert: it probably happens to work if we use the s16 type
(in the same way that our current "half-widening" legalized code will have s16
vregs mapped to s32 GPR).
We could also add an FPR16 mapping, but I suspect we'd have a problem
analoguous to PR32550: if there are FPR8/FPR16 mappings, but no GPR8/GPR16, we
could end up mapping s8/s16 G_LOAD/G_STORE to FPR.
We could also add a GPR16 mapping, to acknowledge the current half-widening
legalization. If some of the instructions are going to be kept around as legal
at s16/s8, they should be fully supported by our mappings, not just happen to
work because we never attempt to fixup the mapping.</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>