]> granicus.if.org Git - llvm/commit
[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)
commitd504c85ea6356a03fef7f3f86df739d54b0750bc
treef6bbb7d1a2b40aaa1ab872a8a9cb2592c491c619
parentb06a386b31f35fd89f86dfe21dcce58389c2aac1
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275773 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
lib/Target/ARM/ARMFastISel.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
test/CodeGen/ARM/divmod-eabi.ll