<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I believe there's a bug in InstCombiner::reassociateShiftAmtsOfTwoSameDirectionShifts(), illustrated by <a href="https://rise4fun.com/Alive/ne8y" style="font-family:Arial,Helvetica,sans-serif">https://rise4fun.com/Alive/ne8y</a>. I'll post a bug on the tracker as soon as I can get an account set up.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Short form: when identifying the two shifts to combine, it does so while ignoring any zero-extensions of those values. In this case, the values are both i1 zero-extended to i3s, so when taking their sum, SimplifyAddInst emits an xor, causing the shift to basically disappear.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I could write more, but the Alive link is probably more concise.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Let me know what you think / if there's some followup needed, etc.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks!</div></div>