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
140 msx64 debian > Flang.Driver::code-gen-rv64.f90
Script: -- : 'RUN: at line 5'; rm -f /var/lib/buildkite-agent/builds/llvm-project/build/tools/flang/test/Driver/Output/code-gen-rv64.f90.tmp.o

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
RKSimon added inline comments.Dec 14 2021, 8:04 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
6813

Wshadow warning vs Idx @ Line 4688?

6846

Wshadow warning vs Idx @ Line 4688?

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

Address comments

Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2022, 7:51 AM
nlopes added inline comments.Aug 26 2022, 7:54 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
9873

Please use PoisonValue whenever possible. It seems this is just a placeholder, so it can be switched.
Thank you!

ABataev added inline comments.Aug 26 2022, 8:08 AM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
9873

Sure, thanks!

ABataev updated this revision to Diff 455933.Aug 26 2022, 8:52 AM

Address comments

nhaehnle removed a subscriber: nhaehnle.Oct 19 2022, 2:00 AM
ABataev updated this revision to Diff 480583.Dec 6 2022, 12:45 PM

Large update.
Includes:

  1. Unifies all shuffle builders and shuffle demission operands.
  2. Generalizes emission and cost model estimation of the buildvectors/gathers.

Will be splitted into several smaller patches eventually.

ABataev updated this revision to Diff 482619.Dec 13 2022, 1:32 PM

Restore accidentally removed code.

khchen added a subscriber: khchen.Dec 22 2022, 8:35 AM
ABataev updated this revision to Diff 503510.Wed, Mar 8, 1:56 PM

Restore deleted code/update test

RKSimon added inline comments.Mon, Mar 13, 2:27 PM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
6731

Any chance that we can use ShuffleVectorInst::isIdentityMask ?

7180

auto *

7182

auto *

ABataev added inline comments.Mon, Mar 13, 2:42 PM
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
6731

Sure, will do it later

7182

Both these cases are the existing code, just the diff is not quite correct because of the big differences.

ABataev updated this revision to Diff 504861.Mon, Mar 13, 3:10 PM

Restore accidentally removed lines, address comments

ABataev updated this revision to Diff 505467.Wed, Mar 15, 6:16 AM

Restore some deleted code