[all-commits] [llvm/llvm-project] 1fa8fd: Recommit "[TargetLowering][RISCV][X86] Support eve...

Craig Topper via All-commits all-commits at lists.llvm.org
Mon Oct 24 10:09:21 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1fa8fd4c33cbb6bcf473c36f179640e2a8b4dd32
      https://github.com/llvm/llvm-project/commit/1fa8fd4c33cbb6bcf473c36f179640e2a8b4dd32
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-10-24 (Mon, 24 Oct 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/test/CodeGen/RISCV/split-udiv-by-constant.ll
    M llvm/test/CodeGen/RISCV/split-urem-by-constant.ll
    M llvm/test/CodeGen/X86/divide-by-constant.ll
    M llvm/test/CodeGen/X86/divmod128.ll

  Log Message:
  -----------
  Recommit "[TargetLowering][RISCV][X86] Support even divisors in expandDIVREMByConstant."

This reverts commit 65aaecca8842dec30d03734a7fe8ce33c5afec81.

There was an ordering problem in the calculation of the partial
remainder.

Original commit message:

If the divisor is even, we can first shift the dividend and divisor
right by the number of trailing zeros. Now the divisor is odd and we
can do the original algorithm to calculate a remainder. Then we shift
that remainder left by the number of trailing zeros and add the bits
that were shifted out of the dividend.

Differential Revision: https://reviews.llvm.org/D135541




More information about the All-commits mailing list