Improved fix for PR17827 (instcombine of shift/and/compare).