<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/153008>153008</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[RISCV] Assert fail on loop-vectorize pass
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
amitch1999
</td>
</tr>
</table>
<pre>
Hi,
Compiling a test taken from gcc (`/gcc/gcc/testsuite/gcc.c-torture/compile/pr39943.c`) :
```
void gl_fog_index_pixels(float f, unsigned int n, unsigned int index[])
{
unsigned int i;
for (i=0; i<n; i++)
index[i] = (unsigned int) ((float) index[i] + (1.0F-f));
}
```
Compilation command:
`clang ./pr39943.c -march=rv64imfdc_zve64x -mabi=lp64d -c -O2`
Crashes on an assert:
```
/llvm-project/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp:1323:
llvm::InstructionCost llvm::RISCVTTIImpl::getCastInstrCost(unsigned int,
llvm::Type*,
llvm::Type*,
llvm::TargetTransformInfo::CastContextHint,
llvm::TargetTransformInfo::TargetCostKind,
const llvm::Instruction*):
Assertion `(SrcLT.first == 1) && (DstLT.first == 1) && "Illegal type"' failed.
```
I tried this on the current HEAD (`ccd35e5b2f1438646d11c27eaa475f34681f9cbe`)
And on 20.1.8 (`87f0227cb60147a26a1eeb4fb06e3b505e9c7261`)
The same happens on both.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVMmurDYTfhr3xmrkgckLFj38rdP6I0XKbWV7ZEwBTsBGtumce58-sul7RiWKhABXub76apTe68EANKg4ouK8k2sYrWvkrIMaqRBi19rue_OkETthRA6IHE52XvSkzYAlDuADDvJPMLh3dsaDUhixGpUEscug1Os7XvSrDrBJMrUP1oXVxbNKgPFvcVyInGcqAQiMeHQYD9tDDnerOzxMz70dnrXp4OV50S8wecTqfrIy4D4SXU2KqsPaBGy-SJLhFjBiInqojjG4T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