Page MenuHomePhabricator

[SLP]Improve gathering of the scalars used in the graph.
Needs ReviewPublic

Authored by ABataev on Oct 1 2021, 4:10 PM.

Details

Summary

Currently we emit gathers for scalars being vectorized in the tre as
a pair of extractelement/insertelement instructions. Instead we can try
to find all required vectors and emit shuffle vector instructions
directly, improving the code and reducing compile time.

Diff Detail

Unit TestsFailed

TimeTest
100 msx64 debian > LLVM.Bindings/Go::go.test
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-go go=/usr/bin/go test llvm.org/llvm/bindings/go/llvm

Event Timeline

ABataev created this revision.Oct 1 2021, 4:10 PM
ABataev requested review of this revision.Oct 1 2021, 4:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 1 2021, 4:10 PM
RKSimon retitled this revision from [SLP]Improve gathering of the scals used in the graph. to [SLP]Improve gathering of the scalars used in the graph..Oct 5 2021, 6:35 AM
ABataev updated this revision to Diff 386648.Nov 11 2021, 1:34 PM

Rebase + bug fixes

vporpo added a subscriber: vporpo.Nov 11 2021, 7:57 PM
RKSimon added inline comments.Nov 29 2021, 9:13 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
296

Is it worth merging the isa<> and cast<> into a dyn_cast<>?

489

return None instead to make it obvious it failed?

Maybe do this as an early out instead of the much bigger if (Res.hasValue()) indented block?

4780

What targets are we still missing support for?

ABataev added inline comments.Nov 29 2021, 9:15 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
4780

AArch64, in many cases switches to the default cost bunch of extracts + bunch of inserts.

ABataev updated this revision to Diff 390398.Nov 29 2021, 10:06 AM

Rebase + address comments.

RKSimon added inline comments.Dec 14 2021, 8:04 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
4742

Wshadow warning vs Idx @ Line 4688?

4777

Wshadow warning vs Idx @ Line 4688?

ABataev updated this revision to Diff 394269.Dec 14 2021, 8:33 AM

Address comments