[llvm] [InstCombine] Fold `lshr -> zext -> shl` patterns (PR #147737)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 06:30:25 PDT 2025


zGoldthorpe wrote:

I've modified `canEvaluateShifted()` so that rather than just verifying that a certain shift amount is viable for simplification (via `getShiftedValue()`), it performs this query with a mask of shift amounts simultaneously. This allows my patch to find a suitable shift amount in one pass, rather than recursing through to find an inner `lshr` and then verifying it can be simplified away.

https://github.com/llvm/llvm-project/pull/147737


More information about the llvm-commits mailing list