The 'and (sext (ashr X, ShiftC)), C' --> 'lshr (sext X), ShiftC'
transformation would access out of bounds bits in APInt::getLowBitsSet
if the shift count was larger than X's bit width or negative.
Fixes #56424
Differential D129306
[InstCombine] Do not fold 'and (sext (ashr X, Shift)), C' if Shift < 0 BertalanD on Jul 7 2022, 9:32 AM. Authored by
Details
Diff Detail
Unit Tests Event Timeline
Comment Actions Added a link to the issue, switched to the new PM syntax and named the arguments. Thank you for the review Comment Actions Whoops, totally forgot about the "Differential Revision:" trailer, sorry. Committed as ef7aed3e112b47641ca2704187d3701765a831ce. Comment Actions My suggestion was to add the test around here rather than create a new file for just this one test: Comment Actions
Argh, today's not my day then 🤦 |
might be worth to switch to the new pass manager syntax (-passes=instcombine)