[llvm-dev] [RFC] Improving integer divide optimization (related to D12082)

Steve King via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 19 17:00:59 PDT 2015

On Wed, Aug 19, 2015 at 3:48 PM, escha <escha at apple.com> wrote:
> On Aug 19, 2015, at 1:45 PM, Steve King via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> In the targets I know, shifts are
> cheaper than divides in both speed and size.
> From what I remember, udiv by power of 2 already gets turned into a shift in
> instcombine; the tricky case is sdiv by power of 2, which takes
> significantly more than one instruction.

Thanks escha.  I fooled myself and all the offending cases in my
target were indeed SDIVs.

More information about the llvm-dev mailing list