Page MenuHomePhabricator

[SLP]Improve vectorization of phi nodes by trying wider vectors.
ClosedPublic

Authored by ABataev on Aug 25 2021, 4:13 PM.

Details

Summary

Try to improve vectorization of the PHI nodes by trying to vectorize
similar instructions at the size of the widest possible vectors, then
aggregating with compatible type PHIs and trying to vectoriza again and
only if this failed, try smaller sizes of the vector factors for
compatible PHI nodes. This restores performance of several benchmarks
after tuning of the fp/int conversion instructions costs.

Diff Detail

Event Timeline

ABataev created this revision.Aug 25 2021, 4:13 PM
ABataev requested review of this revision.Aug 25 2021, 4:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2021, 4:13 PM
llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
101

Comment new arg?

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
9112

Looks like we need comment here as well: why setting LimitForRegisterSize for phi nodes.

9139

We get here unnecessarily if Candidates.size() == 1.

ABataev updated this revision to Diff 368968.Aug 26 2021, 1:08 PM

Address comments

anton-afanasyev accepted this revision.Aug 27 2021, 3:13 AM

Address comments

LGTM, thanks!

This revision is now accepted and ready to land.Aug 27 2021, 3:13 AM
wxiao3 added a subscriber: wxiao3.Sep 12 2021, 7:59 AM
This revision was landed with ongoing or failed builds.Tue, Sep 28, 7:21 AM
This revision was automatically updated to reflect the committed changes.