This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] SILoadStoreOptimizer: rewrite checkAndPrepareMerge. NFCI.
ClosedPublic

Authored by foad on Feb 4 2022, 6:47 AM.

Details

Summary

Separate the function clearly into:

  • Checks that can be done on CI and Paired before the loop.
  • The loop over all instructions between CI and Paired.
  • Checks that must be done on InstsToMove after the loop.

Previously these were mostly done inside the loop in a very
confusing way.

Diff Detail

Event Timeline

foad created this revision.Feb 4 2022, 6:47 AM
foad requested review of this revision.Feb 4 2022, 6:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2022, 6:47 AM
piotr accepted this revision.Feb 4 2022, 8:45 AM

LGTM

llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
949

Not related to your change, but the mention of "DS" is a left-over from the times this pass only handled ds_read/ds_write. Can you please remove it before committing (no need to resubmit)?

This revision is now accepted and ready to land.Feb 4 2022, 8:45 AM
This revision was landed with ongoing or failed builds.Feb 4 2022, 9:19 AM
This revision was automatically updated to reflect the committed changes.