[InstCombine] C0 <<{nsw, nuw} (X - C1) --> (C0 >> C1) << X (2nd try)
The first attempt at this missed a check to make sure the offset constant was in range and caused many bot failures. That was missed in the Alive2 proof because on overshift creates poison rather than the assert from APInt. Here's an alternate attempt at a proof using count-trailing-zeros: https://alive2.llvm.org/ce/z/pnXQYR Original commit message: This is similar to an existing pre-shift-of-constant fold: 8a9c70fc ...but in this case, we need no-wrap on the shl and a negative offset: https://alive2.llvm.org/ce/z/_RVz99
Loading
Please sign in to comment