[PATCH] D62166: [mips] Always check that `shift and add` optimization is efficient

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 15:43:45 PDT 2019


atanasyan created this revision.
atanasyan added reviewers: sdardis, abeserminji, Petar.Avramovic.
Herald added subscribers: dexonsmith, jrtc27, hiraditya, arichardson, mehdi_amini.
Herald added a project: LLVM.

The D45316 <https://reviews.llvm.org/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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62166

Files:
  llvm/lib/Target/Mips/MipsSEISelLowering.cpp
  llvm/test/CodeGen/Mips/const-mult.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62166.200368.patch
Type: text/x-patch
Size: 16080 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190520/fffa6003/attachment.bin>


More information about the llvm-commits mailing list