[llvm-dev] InstCombiner bug

Rob Springer via llvm-dev llvm-dev at lists.llvm.org
Tue Feb 4 09:09:56 PST 2020


I believe there's a bug
in InstCombiner::reassociateShiftAmtsOfTwoSameDirectionShifts(),
illustrated by https://rise4fun.com/Alive/ne8y. I'll post a bug on the
tracker as soon as I can get an account set up.

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.

I could write more, but the Alive link is probably more concise.

Let me know what you think / if there's some followup needed, etc.
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200204/3a1bce75/attachment.html>


More information about the llvm-dev mailing list