HomePhabricator

[mips] Materialize constants for multiplication

Authored by sdardis on Apr 13 2018, 9:09 AM.

Description

[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

llvm-svn: 330037

Details

Committed
sdardisApr 13 2018, 9:09 AM
Differential Revision
D45316: [mips] Materialize constants for multiplication
Parents
rGea2c78369c3d: Reduce code duplication.
Branches
Unknown
Tags
Unknown