[PATCH] D130862: [LegalizeTypes] Improve splitting for urem by constant for some constants.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 11:36:12 PDT 2022


craig.topper added a comment.

In D130862#3691543 <https://reviews.llvm.org/D130862#3691543>, @nickdesaulniers wrote:

> Can we add an additional test to llvm/test/CodeGen/ARM/div.ll that `urem` with a small constant does not produce a libcall to `__aeabi_uldivmod`?

Sure. I can do that.

> The change to llvm/lib/Target/X86/X86ISelLowering.cpp makes me wonder how many backend-specific changes are necessary here.



> Also, not sure if this is something we only want to do for `-O2` (vs `-Os`)?

I put in the isIntDivCheap check to catch the targets that restricted div by constant expansion for -Oz. Though maybe I need to check that for HiLoVT too since we're kind of assuming HiLoVT UREM will be expanded by DAGCombiner.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130862



More information about the llvm-commits mailing list