[llvm] [DemandedBits] Add div/rem support (PR #148853)
Panagiotis K via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 16 08:11:58 PDT 2025
karouzakisp wrote:
> > @nikic Thanks for the proofs. I will try to keep kind of the same format on the other PRs.
>
> How about keeping it in mind for this PR as well? The new sdiv code is still incorrect. Including the sign bit is not enough: https://alive2.llvm.org/ce/z/J7yBrc
>
I know, I am working to fix it. I will create/update all the proofs afterwards.
> > Regarding the udiv/urem being useless, I thought that some transformations might happen to them. But, are we sure that the conversion will happen before any pass cares about DemandedBits?
>
> It's theoretically possible, but as a rule, we don't handle non-canonical instruction forms unless there is specific proof that handling them is necessary.
In my understanding, enabling it can produce new knowledge on some chains that have srem before canonicalization. You know the IR better, so I leave it to you.
https://github.com/llvm/llvm-project/pull/148853
More information about the llvm-commits
mailing list