This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] WQM: Allow insertion of exact mode transition as terminator
ClosedPublic

Authored by critson on May 31 2023, 5:06 AM.

Details

Summary

Allow WQM pass to insert transitions to exact mode among block
terminators, instead of forcing them to occur before terminators.

This should not yield any functional change, but allows block
splitting of control flow, such as that in D145329.

Diff Detail

Event Timeline

critson created this revision.May 31 2023, 5:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2023, 5:06 AM
critson requested review of this revision.May 31 2023, 5:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2023, 5:06 AM

Missing test updates?

llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
1223–1224

Wouldn’t this need a block split and always use the terminator?

Missing test updates?

There are no test updates as code gen is the same. Observationally this is NFCI.

llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
1223–1224

We don't currently block split exec mask changes in WQM pass except for kill/demote.
I will look at adding splits on all exec changes (as a follow up patch), in which case it will always be a terminator.

I need to carefully evaluate the impact on codegen of all the additional blocks generated in splitting.
Since this is working for us right now I am not keen to rush to change it.

arsenm accepted this revision.Jun 1 2023, 10:43 AM

LGTM. It's forward progress although I think we're still on shaky ground with intermediate exec changes

This revision is now accepted and ready to land.Jun 1 2023, 10:43 AM
foad added inline comments.Jun 1 2023, 11:46 AM
llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
1213–1217

Simpler to use comesBefore? It is supposed to be efficient.

critson marked 2 inline comments as done.Jun 1 2023, 6:33 PM
critson added inline comments.
llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
1213–1217

comesBefore isn't defined for machine instructions, otherwise, yes.

This revision was automatically updated to reflect the committed changes.
critson marked an inline comment as done.