<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/74231>74231</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Failed asserts since “[VPlan] Replace IR based truncateToMinimalBitwidths with VPlan version”
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:AArch64,
regression
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mstorsjo
</td>
</tr>
</table>
<pre>
Since 70535f5e609f747c28cfef699eefb84581b0aac0, the following snippet triggers failed asserts:
```c
short *a;
int b, c;
void d() {
int e, f = c;
for (; b; b++) {
e = a[b];
if (e) {
if (e < 0)
e = -f;
a[b] = e;
}
}
}
```
Compiled like this:
```console
$ clang -target aarch64-linux-gnu -O2 -c test.c
clang: ../lib/Transforms/Vectorize/VPlanTransforms.cpp:964: static void llvm
::VPlanTransforms::truncateToMinimalBitwidths(llvm::VPlan&, const llvm::MapV
ector<llvm::Instruction*, long unsigned int>&, llvm::LLVMContext&): Assertio
n `MinBWs.size() == NumProcessedRecipes && "some entries in MinBWs haven't b
een processed"' failed.
```
CC @fhahn
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VNtu5CgQ_Zrql1K3aPD1wQ99mZZGmuyOsqPsM8ZlmxkaLMDJ7H79yriTTvYmIRuqOKegOFUyBD1YogbyI-TnjZzj6HxzDdH58N1tWtf90fymrSLEkuUi73MqWN2XWal4pXrqi7om6tsqy6t9y6RUDPgJ40jYO2Pci7YDBquniSJGr4eBfMBeakMdyhDIxwDiAOwM7AAFW4da12F0PiLwgwRxXE3aRmyXCOrN9Ox0hx3wCniNUN6siMtWWrb2COL8DoDYO48LQByxXT_8mMYHAkRKSAn5sYX8_I4AUfcLA_0D8uZBECdkwOv3vlfKbf-BDN9iJC99cEJ5fl28Te-T15Tdlul7ctcpJdjoH4Rx1P-WYmeDM3Sz8gyVkXbAbZR-oIhSejUW2dZo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