]> granicus.if.org Git - llvm/commit
Merging r330037:
authorTom Stellard <tstellar@redhat.com>
Fri, 18 May 2018 23:24:43 +0000 (23:24 +0000)
committerTom Stellard <tstellar@redhat.com>
Fri, 18 May 2018 23:24:43 +0000 (23:24 +0000)
commit057310b8fc41e5089dbee0d2c90e4233756a83c9
tree36d65ce9dd7e7739945cad4f8f5834072c4a16f2
parentcf2e9a6c25f39042db44c00d6731f96dc072419d
Merging r330037:

------------------------------------------------------------------------
r330037 | sdardis | 2018-04-13 09:09:07 -0700 (Fri, 13 Apr 2018) | 21 lines

[mips] Materialize constants for multiplication

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 PR36884.

Thanks to npl for reporting the issue!

Reviewers: abeserminji, smaksimovic

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

------------------------------------------------------------------------

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