[llvm] [InstCombine] Fold `[l|a]shr iN (X-1)&~X, N-1 -> [z|s]ext(X==0)` (PR #107259)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 12:09:07 PDT 2024


nikic wrote:

> Also think a better place for this would be `simplifyDemandedBits`. There are a lot of patterns in the bits based on `X` and `C`(1) in this case.

So the pattern would be something like this? https://alive2.llvm.org/ce/z/FqAbpX I guess that's fine assuming this actually occurs with non-lshr/ashr demanded bits contexts and the additional one-use limitation is unproblematic for motivating cases.

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


More information about the llvm-commits mailing list