https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87062

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-08-23
             Blocks|                            |53947
     Ever confirmed|0                           |1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
A dup of PR84101 and others.  The vectorizer has a hard time accounting for
ABI details of parameter passing and return value handling because those are
not reflected in GIMPLE.  There's a patch posted that maybe handles this
case, but I don't see a RESULT_DECL in the IL so it might not:

fret (long int i)
{
  struct pair D.7982;

  <bb 2> [local count: 1073741825]:
  MEM[(struct pair *)&D.7982] = i_2(D);
  MEM[(struct pair *)&D.7982 + 8B] = i_2(D);
  return D.7982;

}

that is, the vectorizer doesn't know D.7982 is forcefully allocated to
a rax/rdx register pair but thinks it is memory (it is memory in GIMPLE).

A heuristic besides the one in the posted patch would be to slightly
pessimize non-TREE_ADDRESSABLE sources/destinations for vectorization,
but if the ABI would return std::pair<long, long> in %xmm0 we'd lose.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations

Reply via email to