Legalizer optimize a pair of div / mod to a call to divrem libcall if they are
authorEvan Cheng <evan.cheng@apple.com>
Fri, 12 Oct 2012 01:15:47 +0000 (01:15 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 12 Oct 2012 01:15:47 +0000 (01:15 +0000)
commitd36696c4e0ccd10a91bad2e3383c50347e2ea5ec
treee7f718f97621f9099197ece766895a35ab8187f8
parent5665a3dbc909c1450ac17e311977cbaf9025525b
Legalizer optimize a pair of div / mod to  a call to divrem libcall if they are
not legal. However, it should use a div instruction + mul + sub if divide is
legal. The rem legalization code was missing a check and incorrectly uses a
divrem libcall even when div is legal.

rdar://12481395

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165778 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
test/CodeGen/ARM/divmod.ll