This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Extend support for folding select + masked gathers
ClosedPublic

Authored by MattDevereau on Apr 1 2022, 5:41 AM.

Diff Detail

Event Timeline

MattDevereau created this revision.Apr 1 2022, 5:41 AM
Herald added a project: Restricted Project. · View Herald Transcript
MattDevereau requested review of this revision.Apr 1 2022, 5:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2022, 5:41 AM
MattDevereau retitled this revision from [SVE] Extend support for folding select + masked gathers to [InstCombine] Extend support for folding select + masked gathers.Apr 4 2022, 3:34 AM
peterwaller-arm accepted this revision.Apr 4 2022, 4:15 AM

Accept with some nits in the tests which need fixing.

llvm/test/Transforms/InstCombine/select-masked_gather.ll
4–5

Test names refer to load but are testing gather. Worth differentiating for so they're easy to grep for. Please update references to 'load' in function names (also, in comments).

123

This intrinsic appears to be incorrectly named, since it's vscale x 2 x float, so it should be nxv2f32. That one is already available on line 125.

124–125

These two intrinsics both have a have p0 in their titles but the arrangement of it is inconsistent. Looking at other tests, this part of the intrinsic name is often elided, so it would just be:

declare <vscale x 2 x i32> @llvm.masked.gather.nxv2i32(<vscale x 2 x i32*>, i32, <vscale x 2 x i1>, <vscale x 2 x i32>)
declare <vscale x 2 x float> @llvm.masked.gather.nxv2f32(<vscale x 2 x float*>, i32, <vscale x 2 x i1>, <vscale x 2 x float>)

or if you want to use the full name take a look at the CHECK lines in these tests which have e.g. llvm.masked.gather.nxv2f32.nxv2p0f32 which looks to be the fully qualified way of writing it.

This revision is now accepted and ready to land.Apr 4 2022, 4:15 AM
This revision was landed with ongoing or failed builds.Apr 5 2022, 9:28 AM
This revision was automatically updated to reflect the committed changes.