[X86] Do not lower scalar sdiv/udiv to a shifts + mul sequence when optimizing for...
authorMichael Kuperstein <michael.m.kuperstein@intel.com>
Wed, 19 Aug 2015 11:21:43 +0000 (11:21 +0000)
committerMichael Kuperstein <michael.m.kuperstein@intel.com>
Wed, 19 Aug 2015 11:21:43 +0000 (11:21 +0000)
commite8a6608a7509f81223e9d9e286d90ce9ad4f5ed3
tree56763ca3220beee0a26d29abae35494a9efd004f
parenta4fe29414d883239042d49813e28f0db7fd92391
[X86] Do not lower scalar sdiv/udiv to a shifts + mul sequence when optimizing for minsize

There are some cases where the mul sequence is smaller, but for the most part,
using a div is preferable. This does not apply to vectors, since x86 doesn't
have vector idiv, and a vector mul/shifts sequence ought to be smaller than a
scalarized division.

Differential Revision: http://reviews.llvm.org/D12082

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245431 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
test/CodeGen/X86/divide-by-constant.ll
test/CodeGen/X86/vec_sdiv_to_shift.ll