This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Handle constant splat in funnel shift combine
ClosedPublic

Authored by abinavpp on May 12 2022, 8:37 PM.

Details

Summary

This change adds the constant splat versions of m_ICst() (by using
getBuildVectorConstantSplat()) and uses it in
matchOrShiftToFunnelShift(). The getBuildVectorConstantSplat() name is
shortened to getIConstantSplatVal() so that the *SExtVal() version would
have a more compact name.

Diff Detail

Event Timeline

abinavpp created this revision.May 12 2022, 8:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2022, 8:37 PM
abinavpp requested review of this revision.May 12 2022, 8:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2022, 8:37 PM
abinavpp updated this revision to Diff 429133.May 12 2022, 8:49 PM

Moved matchConstantSplat() closer to struct ICstOrSplatMatch

foad added a comment.May 13 2022, 1:47 AM

Looks reasonable to me.

llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fsh.mir
135

Precommit this?

llvm/test/CodeGen/AMDGPU/GlobalISel/combine-rot.mir
125

Precommit this?

abinavpp updated this revision to Diff 429200.May 13 2022, 4:29 AM

Pre-committed tests

foad accepted this revision.May 13 2022, 5:16 AM

LGTM. Maybe wait a day in case anyone else has opinions about the names you used for the new matchers.

llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
137

No else after return.

This revision is now accepted and ready to land.May 13 2022, 5:16 AM

Name changes look good to me. Wait a little if @paquette or @aemerson have comments.

arsenm accepted this revision.May 13 2022, 6:53 AM
paquette accepted this revision.May 13 2022, 9:57 AM

Aside from @foad's one comment, I think this looks fine.

abinavpp updated this revision to Diff 429669.May 16 2022, 3:32 AM

Rebased; Addressed review comment

abinavpp marked an inline comment as done.May 16 2022, 3:35 AM
This revision was landed with ongoing or failed builds.May 16 2022, 3:37 AM
This revision was automatically updated to reflect the committed changes.