<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/75510>75510</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[DAG] SelectionDAGBuilder::getValueImpl ASSERT: isa<To>(Val) && "cast<Ty>() argument of incompatible type!"
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
RKSimon
</td>
</tr>
</table>
<pre>
Reduced from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64839
```ll
define void @foo() {
entry:
%x3 = tail call i1 @llvm.type.test(ptr undef, metadata !"foo")
unreachable
}
declare i1 @llvm.type.test(ptr, metadata)
```
llc -mtriple=x86_64--
```asm
.text
.file "fuzz.ll"
Assertion failed: isa<To>(Val) && "cast<Ty>() argument of incompatible type!", file E:\llvm\llvm-project\llvm\include\llvm/Support/Casting.h, line 578
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: ninja\\bin\\llc -mtriple=x86_64-- fuzz.ll -o -
1. Running pass 'Function Pass Manager' on module 'fuzz.ll'.
2. Running pass 'X86 DAG->DAG Instruction Selection' on function '@foo'
Exception Code: 0x80000003
#0 0x00007ff6f1cad7d5 HandleAbort E:\llvm\llvm-project\llvm\lib\Support\Windows\Signals.inc:424:0
#1 0x00007ff862e51881 (C:\Windows\System32\ucrtbase.dll+0x71881)
#2 0x00007ff862e52851 (C:\Windows\System32\ucrtbase.dll+0x72851)
#3 0x00007ff862e5426e (C:\Windows\System32\ucrtbase.dll+0x7426e)
#4 0x00007ff862e54165 (C:\Windows\System32\ucrtbase.dll+0x74165)
#5 0x00007ff862e544f1 (C:\Windows\System32\ucrtbase.dll+0x744f1)
#6 0x00007ff6f0840e66 E:\llvm\llvm-project\llvm\include\llvm\Support\Casting.h:580:0
#7 0x00007ff6f1a0b323 llvm::SelectionDAGBuilder::getValueImpl(class llvm::Value const *) E:\llvm\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAGBuilder.cpp:1891:0
#8 0x00007ff6f1a09ca2 llvm::SelectionDAGBuilder::getValue(class llvm::Value const *) E:\llvm\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAGBuilder.cpp:1708:0
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVtuO2zgS_Rr6pWBBIkVJfvCD2pfeYHeBoB1k921AkZTMhCIFkkrc-foBJV_aBjJIGhhgBAOWqlin6hQPL8x71Rkp14g-IbpdsDEcrVu__PugemsWjRWv6xcpRi4FtM72cAxh8IjUCO8R3jdj5xN-dLZXY59Y1yG8HxDeW--X7fjjB8J75f0oPcJ7IQNTGpG9Eohsi7wiK5RuUVqjIp1_Ws8GIVtlJHyzSgDK09ZahCuEV4DKp3mENMG9xiqmLwCE6YkAIluIOYAzrUFlMVjrb30SXgeZBOkDwtUQHIxGyBbhDfQyMMECA4QzhPGUCSO8uuCOxknGj6zR8lxrub3UyDVz8i-yvMW_Ql65zp9ac1j2walBS0S2p6r4o8iXS3gYzHx_qWh-kiBP4WxKWqUlxB7g2PJE68hh8tXeSxeUNdAypaVApAblGSKbTxaRHcLVZ6anxuIC4SJCcOZD9L_O_uhkrht7aQLYFpThth9YUI2WEAnPjYtcpzJ2cVLoJvbj_LccnP0iebhZleF6FPJiwPvDOAzWBYT3G-aDMl1yjIA6ioCW1czl43929WEHfmx6FYBBM3bgZIyDYB9k2alwHJuE24h-TnJXyxtZAjMCziVBOErgjvkjNIx_DY5xmczpD4HxryDGfrjKLk3myfjobOdYf-1TrAOMMl8YohtEN40y88vPZvs8bbC0sJyhszP0y2iMMh0MzHtAuNyPhk_z-TEa_ssM66RDuARroLdi1DKOusqgPBePfwL3_6qAbf28RGS3rZ_hg_HBjXOCg9Ryejujt5fMCJeXNVnO6LsTl8Pk21ghI_n0VKXTQ84aRZikkJ6iqWzbos04E6Wg8C9m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