This is an archive of the discontinued LLVM Phabricator instance.

[TTI] Add hook for vector extract with extension
ClosedPublic

Authored by mssimpso on Mar 28 2016, 1:48 PM.

Details

Summary

This change adds a new cost model hook for estimating the cost of vector extracts followed by zero- and sign-extensions. The motivating example for this change is the SMOV and UMOV instructions on AArch64. These instructions move data from vector to general purpose registers while performing the corresponding extension (sign-extend for SMOV and zero-extend for UMOV) at the same time. For these operations, TargetTransformInfo can assume the extensions are free and only report the cost of the vector extract. I've modified the SLP vectorizer to make use of the new hook.

Please note that this patch is a significantly scaled down version of D15816. This patch focuses on one specific operation (extract with extension) whereas the other patch sought to fully contextualize the cost model estimates.

Diff Detail

Repository
rL LLVM

Event Timeline

mssimpso updated this revision to Diff 51832.Mar 28 2016, 1:48 PM
mssimpso retitled this revision from to [TTI] Add hook for vector extract with extension.
mssimpso updated this object.
mssimpso added reviewers: jmolloy, hfinkel, mcrosier.
mssimpso added a subscriber: llvm-commits.
anemet added a subscriber: anemet.Apr 5 2016, 3:27 PM
jmolloy accepted this revision.Apr 25 2016, 7:15 AM
jmolloy edited edge metadata.

Hi,

This looks fine to me.

Cheers,

James

This revision is now accepted and ready to land.Apr 25 2016, 7:15 AM

Thanks very much for the review, James!

This revision was automatically updated to reflect the committed changes.