This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Account for phi cost in both scalar and vectors
Changes PlannedPublic

Authored by luke on Apr 25 2023, 10:25 AM.

Details

Summary

Use TTI::getPHICost to work out the cost of a phi instruction for
scalars and vectors, because they may not be free. Specifically, if the
phi has constant operands, there may be a cost to materializing them.

Fixes https://github.com/llvm/llvm-project/issues/62327

Diff Detail

Event Timeline

luke created this revision.Apr 25 2023, 10:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2023, 10:25 AM
luke requested review of this revision.Apr 25 2023, 10:25 AM
luke added inline comments.
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
7334

I'm assuming here that all VLs must be a PHI at this point. Is this correct?

luke planned changes to this revision.Jun 29 2023, 5:53 AM

After discussing offline with @reames, we're not sure if this is the most accurate way to model constant costs in phi nodes. Moving it off the review queue for the meantime