[PATCH] D66098: [CostModel] Model all `extractvalue`s as free.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 11:17:43 PDT 2019


lebedev.ri added a comment.

In D66098#1627477 <https://reviews.llvm.org/D66098#1627477>, @greened wrote:

> LGTM, though are we sure this is true for all targets?  The comments in the referenced patch only consider X86.  I'm pretty sure it is true for common architectures like AArch64 but I'm not as sure for more exotic things.


I have asked the exact same question before:

In D65148#1625432 <https://reviews.llvm.org/D65148#1625432>, @craig.topper wrote:

> In D65148#1624962 <https://reviews.llvm.org/D65148#1624962>, @lebedev.ri wrote:
>
> > In D65148#1624762 <https://reviews.llvm.org/D65148#1624762>, @craig.topper wrote:
> >
> > > Did anything happen with the extractvalue cost suggestion?
> >
> >
> > I was planning to look into that, and i just did. Some observations:
> >
> > 1. I'm not sure we can literally treat any `extractvalue` as free, it clearly isn't: https://godbolt.org/z/6wIxAa
>
>
> For the short cases, the mov belongs to the return not the extractvalue. For the large cases all of that code is the result of passing an array by value.


So it seems to be the right thing to do..


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66098/new/

https://reviews.llvm.org/D66098





More information about the llvm-commits mailing list