[llvm] [InstCombine] Fold `X udiv Y` to `X lshr cttz(Y)` if Y is a power of 2 (PR #121386)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 10 08:28:31 PST 2025
goldsteinn wrote:
> It would probably make sense to add a takeLog2 based fold for cttz as a follow up. I think that would recover the regression from [dtcxzyw/llvm-opt-benchmark#1908 (comment)](https://github.com/dtcxzyw/llvm-opt-benchmark/pull/1908#discussion_r1900188252).
I think we would probably need a flash for that, or maybe a wrapping function. It makes sense to create `cttz` to avoid a `div`, but probably not a `mul`.
https://github.com/llvm/llvm-project/pull/121386
More information about the llvm-commits
mailing list