[PATCH] D108447: [RISCV] Implement BuildSDIVPow2, use cmov to lower sdiv pow2.

Jianjian Guan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 23 01:50:24 PDT 2021


jacquesguan added a comment.

In D108447#2957748 <https://reviews.llvm.org/D108447#2957748>, @craig.topper wrote:

> Can you add test cases for dividing by power of 2 larger than 4096/-4096? Those will cause the add with pow2-1 to not fit in the an ADDI anymore. So I think that would be worse code?
>
> I'm not sure it is worth doing this right now given that Zbt is not up for ratification and there has been a lot of discussion about how much encoding space cmov uses.

Thanks, Now only perform this transform if the divisor is within 12-bits immediate.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108447/new/

https://reviews.llvm.org/D108447



More information about the llvm-commits mailing list