[PATCH] D126644: [llvm/CodeGen] Add ExpandLargeDivRem pass

Matthias Gehre via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 15:02:30 PDT 2022


mgehre-amd marked an inline comment as done.
mgehre-amd added inline comments.


================
Comment at: llvm/lib/CodeGen/ExpandLargeDivRem.cpp:12
+// This is useful for backends like x86 that cannot lower divisions
+// with more than 128 bits.
+//
----------------
craig.topper wrote:
> mgehre-amd wrote:
> > craig.topper wrote:
> > > I think but haven't checked that 32-bit x86, ARM, RISCV32, and other 32-bit targets can't lower division with more than 64 bits.
> > I checked x86_32 and it lowers 128 bit divisions to __divti3: https://godbolt.org/z/Y6hT9n3x5
> But it fails to link https://godbolt.org/z/5x38Gxqa9 so I think that's a bug. __divti3 doesn't exist in 32-bit libgcc.
That's a good observation! I will update the comment.
I also need to modify the follow-up PR, https://reviews.llvm.org/D130076, 
to set the correct limits for those targets.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126644



More information about the llvm-commits mailing list