[PATCH] D45316: [mips] Materialize constants for multiplication

Simon Dardis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 5 05:54:03 PDT 2018


sdardis created this revision.
sdardis added reviewers: abeserminji, smaksimovic.
Herald added a subscriber: arichardson.

Previously, the MIPS backend would alwyas break down constant multiplications
into a series of shifts, adds, and subs. This patch changes that so the cost of
doing so is estimated.

The cost is estimated against worst case constant materialization and retrieving
the results from the HI/LO registers.

For cases where the value type of the multiplication is not legal, the cost of
legalization is estimated and is accounted for before performing the
optimization of breaking down the constant

This resolves PR 36884.

Thanks to npl for reporting the issue!


Repository:
  rL LLVM

https://reviews.llvm.org/D45316

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45316.141136.patch
Type: text/x-patch
Size: 15336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180405/cd0ba379/attachment.bin>


More information about the llvm-commits mailing list