This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Artifact combine merge-like and unmerges into merge-like
ClosedPublic

Authored by Petar.Avramovic on Sep 3 2021, 9:22 AM.

Details

Summary

Recognize when sub-vectors have been split to elements which are used to
build large vector.
This happens when instructions have different vector sizes available.
For example a few arithmetic instruction are required to process all
elements of larger vector that can be stored using one instruction.

Diff Detail

Event Timeline

Petar.Avramovic created this revision.Sep 3 2021, 9:22 AM
Petar.Avramovic requested review of this revision.Sep 3 2021, 9:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 3 2021, 9:22 AM
Petar.Avramovic retitled this revision from [GlobalISel] Build_vector artifact combine into concat_vector to GlobalISel: Artifact combine build-vector and unmerges into concat-vector.
Petar.Avramovic edited the summary of this revision. (Show Details)
arsenm added inline comments.Jan 18 2022, 10:11 AM
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
1199

I'm having trouble applying this, UnmergeSrcTy seems to not exist

Petar.Avramovic edited the summary of this revision. (Show Details)

There should be no reason to look through copies here, switch to getVRegDef.

llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
1199

I added missing precommit for the stack of build vector patches. UnmergeSrcTy is from D109240

Herald added a project: Restricted Project. · View Herald TranscriptSep 29 2022, 8:06 AM
Herald added a subscriber: kosarev. · View Herald Transcript
arsenm accepted this revision.Sep 29 2022, 12:24 PM

LGTM. I feel like we're missing some legality checks, but the current set of combines seems to have no consistency as to where they are applied

This revision is now accepted and ready to land.Sep 29 2022, 12:24 PM
Petar.Avramovic retitled this revision from GlobalISel: Artifact combine build-vector and unmerges into concat-vector to GlobalISel: Artifact combine merge-like and unmerges into merge-like.
Petar.Avramovic edited the summary of this revision. (Show Details)

Use Value finder to search for unmerged elements. In some tests skips a few combine steps since value finder looks through artifacts.

arsenm accepted this revision.Oct 21 2022, 8:58 AM
This revision was landed with ongoing or failed builds.Oct 24 2022, 4:34 AM
This revision was automatically updated to reflect the committed changes.