<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/55261>55261</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AVR] Failed to expand pseudo instruction
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
benshi001
</td>
</tr>
</table>
<pre>
For the following .ll file
```
declare { } @foo(i128, i128) addrspace(1)
define i128 @bar(i128 %a, i128 %b) addrspace(1) {
%b_neg = icmp slt i128 %b, 0
%divisor = select i1 %b_neg, i128 0, i128 %b
%result = tail call fastcc addrspace(1) {} @foo(i128 undef, i128 %divisor)
ret i128 0
}
```
Build it with `llc -mtriple=avr -mcpu=atmega328 test.ll`. In the generated test.s, we can find several `stdwstk` pseudo instructions are not expanded properly.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUsGO2yAQ_Rp8Ga2F7Th2Dj4kG0XqtYdeKwxjm5aABTjp_n0HJ9lNq0gYGM_Mmzdv6J366E7OQ5wQBmeMu2o7Qm4MDNog40fG9_d9y-9rNRVKIzwCaw70HYFt-OAcK1tdlC0r3-F27kAo5cMsJJKvoB_PmAoHbXENTQC98HcAYGUtHijJ6F9BpeI3IFhjflocgVVH0PI8QzDxOf0d-FOs0hcdqO8UHdCgTLGfIJ-V-b8cvvI9hoXwU3oU2oAUSTIRopSvaf4vESyWun-Gv1P6lAjAY3zQuInWHF_O4rYfFm0U6AhXHScgpzES3s7R65kmWR3FxZMp5yXd4xlHURF0xBBp3BSewze7voMRLXoRUd2cIZG8IrVo6VFYRXpdyG9SiRDVNcTfdIM54KIcaBuiX2TUzgZID8S6CPhnFtSugtm7Gb35yDPVVWpX7UQWdTTYsfqw__Gd1Uc4kZyptLtnvQCGbPGmm2KcA6v2rDzRGqnppc-lO5NhzOVxvFHJXzReMnUIC1I3p7out0U2dapt-TCofuACm61U2O62PZZ1VXJZVE2VGdGjCYkcMct0V_Ky5DXfFLzY8CKv6qLdCdlIHNqqbwQNGM9EP0-Fc-fHzHcrh34ZAzmNDjF8OUUIerSID3yxxMn5rkcbJs15ka2Eu5XtX_ZuFww">