[PATCH] D25332: [ARM] Reapply: Use __rt_div functions for divrem on Windows

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 6 09:32:17 PDT 2016


mstorsjo created this revision.
mstorsjo added reviewers: compnerd, rovka.
mstorsjo added a subscriber: llvm-commits.
Herald added subscribers: rengolin, aemerson.

Reapplying r283383 after revert in r283442. The additional fix is a getting rid of a stray space in a function name, in the refactoring part of the commit.

This avoids falling back to calling out to the GCC rem functions (__moddi3, __umoddi3) when targeting Windows.

The __rt_div functions have flipped the two arguments compared to the __aeabi_divmod functions. To match MSVC, we emit a check for division by zero before actually calling the library function (even if the library function itself also might do the same check).

Not all calls to __rt_div functions for division are currently merged with calls to the same function with the same parameters for the remainder. This is more wasteful than a div + mls as before, but avoids calls to __moddi3.

This is reapplying https://reviews.llvm.org/D24076 with one additional typo fix.


https://reviews.llvm.org/D25332

Files:
  lib/Target/ARM/ARMISelLowering.cpp
  test/CodeGen/ARM/Windows/dbzchk.ll
  test/CodeGen/ARM/divmod-eabi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25332.73809.patch
Type: text/x-patch
Size: 12064 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161006/5f2c6491/attachment.bin>


More information about the llvm-commits mailing list