]> granicus.if.org Git - llvm/commit
[mips] Always check that `shift and add` optimization is efficient.
authorSimon Atanasyan <simon@atanasyan.com>
Fri, 24 May 2019 08:39:40 +0000 (08:39 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Fri, 24 May 2019 08:39:40 +0000 (08:39 +0000)
commit81f980568b9b3df33e427896a2a7881cba83f946
treeaec68b00895afd155e05c9fbcbfefa0f46c915dd
parent033d04ba3ccb9e8b15a544feab93eca481572172
[mips] Always check that `shift and add` optimization is efficient.

The D45316 introduced the `shouldTransformMulToShiftsAddsSubs` function
to check that breaking down constant multiplications into a series
of shifts, adds, and subs is efficient. Unfortunately, this function
does not check maximum number of steps on all paths of the algorithm.
This patch fixes this bug.

Fix for PR41929.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361606 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsSEISelLowering.cpp
test/CodeGen/Mips/const-mult.ll