Attempt to fold trunc (*shr (trunc A), C) --> trunc(*shr A, C) iff the shift amount if small enough that all zero/sign bits created by the shift are removed by the last trunc.
Helps fix the regressions encountered in D88316.
|  Differential  D88429  
[InstCombine] visitTrunc - trunc (*shr (trunc A), C) --> trunc(*shr A, C) Authored by RKSimon on Sep 28 2020, 10:12 AM. 
Details Attempt to fold trunc (*shr (trunc A), C) --> trunc(*shr A, C) iff the shift amount if small enough that all zero/sign bits created by the shift are removed by the last trunc. Helps fix the regressions encountered in D88316. 
Diff Detail 
 Event Timeline
 Comment Actions Please can you post the alive proof you're basing this on? 
 
 
 
 Comment Actions LGTM, but please see https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20200928/835878.html 
 | |||||||||||||||||||||||||||||||||||||||
I do not understand why this isn't just unsigned MaxShiftAmt = AWidth - DestWidth;