[ARM] Honour ABI for rem under -O0 for EABI, GNUEABI, Android and Musl
authorDiana Picus <diana.picus@linaro.org>
Mon, 18 Jul 2016 06:48:25 +0000 (06:48 +0000)
committerDiana Picus <diana.picus@linaro.org>
Mon, 18 Jul 2016 06:48:25 +0000 (06:48 +0000)
commit774d157a5d1a2a03d7d6c724b987588b5c3bb279
tree1c1edcffbbe6e6caa5c27805e41bbea3b42ab87b
parent197228927a84a15e7ca9d30ddc37113078239501
[ARM] Honour ABI for rem under -O0 for EABI, GNUEABI, Android and Musl

At higher optimization levels, we generate the libcall for DIVREM_Ix, which is
fine: aeabi_{u|i}divmod. At -O0 we generate the one for REM_Ix, which is the
default {u}mod{q|h|s|d}i3.

This commit makes sure that we don't generate REM_Ix calls for ABIs that
don't support them (i.e. where we need to use DIVREM_Ix instead). This is
achieved by bailing out of FastISel, which can't handle non-double multi-reg
returns, and letting the legalization infrastructure expand the REM_Ix calls.

It also updates the divmod-eabi.ll test to run under -O0 as well, and adds some
Windows checks to it to make sure we don't break things for it.

Fixes PR27068

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

llvm-svn: 275773
llvm/include/llvm/Target/TargetLowering.h
llvm/lib/Target/ARM/ARMFastISel.cpp
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/lib/Target/ARM/ARMISelLowering.h
llvm/test/CodeGen/ARM/divmod-eabi.ll