llvm/lib
Diana Picus ed0381e438 [ARM] Check for correct HW div when lowering divmod
For subtargets that use the custom lowering for divmod, e.g. gnueabi,
we used to check if the subtarget has hardware divide and then lower to
a div-mul-sub sequence if true, or to a libcall if false.

However, judging by the usage of hasDivide vs hasDivideInARMMode, it
seems that hasDivide only refers to Thumb. For instance, in the
ARMTargetLowering constructor, the code that specifies whether to use
libcalls for (S|U)DIV looks like this:

bool hasDivide = Subtarget->isThumb() ? Subtarget->hasDivide()
                                      : Subtarget->hasDivideInARMMode();

In the case of divmod for arm-gnueabi, using only hasDivide() to
determine what to do means that instead of lowering to __aeabi_idivmod
to get the remainder, we lower to div-mul-sub and then further lower the
div to __aeabi_idiv. Even worse, if we have hardware divide in ARM but
not in Thumb, we generate a libcall instead of using it (this is not an
issue in practice since AFAICT none of the cores that we support have
hardware divide in ARM but not Thumb).

This patch fixes the code dealing with custom lowering to take into
account the mode (Thumb or ARM) when deciding whether or not hardware
division is available.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300536 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 08:32:27 +00:00
..
Analysis [SCEV] Fix another unused variable warning in release builds. 2017-04-17 21:07:26 +00:00
AsmParser [IR] Take func, ret, and arg attrs separately in AttributeList::get 2017-04-13 00:58:09 +00:00
Bitcode PR32382: Fix emitting complex DWARF expressions. 2017-04-18 01:21:53 +00:00
CodeGen [GlobalISel] Support vector-of-pointers in LLT 2017-04-18 08:12:45 +00:00
DebugInfo Add GNU_discriminator support for inline callsites in llvm-symbolizer. 2017-04-17 20:10:39 +00:00
Demangle Add support for demangling C++11 thread_local variables. 2017-01-31 15:56:36 +00:00
ExecutionEngine [ORC] Add RPC and serialization support for Errors and Expecteds. 2017-04-13 03:51:35 +00:00
Fuzzer [libFuzzer] experimental option -cleanse_crash: tries to replace all bytes in a crash reproducer with garbage, while still preserving the crash 2017-04-17 20:58:21 +00:00
IR [IR] Implement DataLayout::getPointerTypeSizeInBits using getPointerSizeInBits directly 2017-04-17 18:22:36 +00:00
IRReader
LibDriver Fix some ArgList uses after API change in r300135. 2017-04-12 23:43:58 +00:00
LineEditor
Linker [Linker] Provide callback for internalization 2017-03-13 18:08:11 +00:00
LTO Object, LTO: Add target triple to irsymtab and LTO API. 2017-04-14 02:55:06 +00:00
MC Distinguish between code pointer size and DataLayout::getPointerSize() in DWARF info generation 2017-04-17 17:41:25 +00:00
Object Object: Shrink the size of irsymtab::Symbol by a word. NFCI. 2017-04-17 23:43:49 +00:00
ObjectYAML Add virtual destructor to WasmYAML::Section or avoid memory leak 2017-03-31 22:14:14 +00:00
Option ArgList: cache index ranges containing arguments with each ID 2017-04-12 23:19:51 +00:00
Passes MemorySSA: Move to Analysis, from Transforms/Utils. It's used as 2017-04-11 20:06:36 +00:00
ProfileData [ProfileData] Unify getInstrProf*SectionName helpers 2017-04-15 00:09:57 +00:00
Support [GlobalISel] Support vector-of-pointers in LLT 2017-04-18 08:12:45 +00:00
TableGen Use print() instead of dump() in code 2017-01-28 02:47:46 +00:00
Target [ARM] Check for correct HW div when lowering divmod 2017-04-18 08:32:27 +00:00
Transforms PR32382: Fix emitting complex DWARF expressions. 2017-04-18 01:21:53 +00:00
XRay [XRay] - Fix spelling error to test commit access. 2017-04-06 03:32:01 +00:00
CMakeLists.txt [XRay] Define the library for XRay trace logs 2017-01-11 06:39:09 +00:00
LLVMBuild.txt